Skip to content

wrangler dev incorrectly recognizes default as named entrypoint #9412

@774u64

Description

@774u64

What versions & operating system are you using?

Wrangler 4.18.0, Node.js v22.15.0, Debian

Please provide a link to a minimal reproduction

https://github.com/774u64/workers-sdk-bug-report

Describe the Bug

When using this workaround to avoid wrangler types generating empty Fetcher types1, wrangler dev incorrectly interprets default as a named entrypoint and aborts with No such named entrypoint runtime error.

wrangler dev -c worker-a/wrangler.jsonc -c worker-b/wrangler.jsonc

worker-a has access to the following bindings:
Binding                                Resource      
env.MY_SERVICE (worker-b#default)      Worker      

❓ Your types might be out of date. Re-run `wrangler types` to ensure your types are correct.
❓ Your types might be out of date. Re-run `wrangler types` to ensure your types are correct.
⎔ Starting local server...
[wrangler:info] Ready on http://localhost:8787
✘ [ERROR] Worker "core:user:worker-a"'s binding "MY_SERVICE" refers to service "core:user:worker-b" with a named entrypoint "default", but "core:user:worker-b" has no such named entrypoint.



✘ [ERROR] The Workers runtime failed to start. There is likely additional logging output above.
{
	"$schema": "node_modules/wrangler/config-schema.json",
	"name": "worker-a",
	"main": "src/index.ts",
	"compatibility_date": "2025-05-29",
	"observability": {
		"enabled": true
	},

	"services": [
		// With no `entrypoint` property specified, `wrangler types` generates an empty Fetcher type.
		// { "binding": "MY_SERVICE", "service": "worker-b" },
		
		// With `entrypoint` property specified with `default`, `wrangler dev` aborts with a runtime error for "No such named entrypoint".
		{ "binding": "MY_SERVICE", "service": "worker-b", "entrypoint": "default" }
	]
}

Please provide any relevant error logs

Generated worker-configuration.d.ts and logs from wrangler dev -c worker-a/wrangler.jsonc -c worker-b/wrangler.jsonc:

Footnotes

  1. Hope this can help: the cause of this workaround is possibly because this line finds for an undefined export when no entrypoint is specified.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething that isn't working

    Type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions