What versions & operating system are you using?
MacOS Latest, Wrangler 4.125
Please provide a link to a minimal reproduction
https://github.com/irvinebroque/repro-esm-entrypoint
Describe the Bug
If you have code like this:
import { WorkerEntrypoint } from "cloudflare:workers";
// This is intentionally the only entrypoint. A named WorkerEntrypoint export is
// valid module-worker syntax and cannot run as a Service Worker.
export class NamedEntrypoint extends WorkerEntrypoint {
fetch(): Response {
return new Response("Hello from the named entrypoint");
}
}
- Wrangler incorrectly selects Service Worker format and fails.
- The Vite plugin warns that default is missing, then adds an empty default export to the bundle.
So you have to do this if you are using Wrangler:
export default {
fetch() {
throw new Error("unimplemented");
},
};
Please provide any relevant error logs
No response
What versions & operating system are you using?
MacOS Latest, Wrangler 4.125
Please provide a link to a minimal reproduction
https://github.com/irvinebroque/repro-esm-entrypoint
Describe the Bug
If you have code like this:
So you have to do this if you are using Wrangler:
Please provide any relevant error logs
No response