Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: deno serve errors on fetch callback with no arguments #23651

Closed
marvinhagemeister opened this issue May 2, 2024 · 0 comments · Fixed by #23652
Closed

Bug: deno serve errors on fetch callback with no arguments #23651

marvinhagemeister opened this issue May 2, 2024 · 0 comments · Fixed by #23652
Assignees
Labels
bug Something isn't working serve

Comments

@marvinhagemeister
Copy link
Contributor

The fetch callback handler validation errors when the callback has no arguments.

Steps to reproduce

// main.ts
export default {
  fetch() {
    return new Response("it works");
  },
};

Then run deno serve main.ts

Error

error: Uncaught (in promise) TypeError: Invalid type for fetch: must be a function with a single parameter
    at registerDeclarativeServer (ext:deno_http/00_serve.ts:547:13)
    at ext:runtime_main/js/99_main.js:722:21

Version: Deno 1.43.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working serve
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants