Pointing subdomain to worker - route question

Let’s say I have a domain example.blog.

I am trying to setup a worker with route workers.example.blog. As mentioned on Workers DNS Host, I have setup a A record pointing workers to the IPv4 address of example.blog.

I have also ensured that the orange icon is turned on for workers record.

My wrangler.toml file looks like this:

name = "Worker"
type = "webpack"
zone_id = ""
private = false
account_id = "actual-ID-here"
route = "workers.example.blog"

But, when publishing using wrangler publish, I see this error:

wrangler publish
⬇️ Installing wasm-pack...
⬇️ Installing wranglerjs...
✨   Built successfully.
Error: ErrorMessage { msg: "⛔ Something went wrong! Status: 400 Bad Request, Details {\n  \"result\": null,\n  \"success\": false,\n  \"errors\": [\n    {\n      \"code\": 10016,\n      \"message\": \"workers.api.error.invalid_script_name\"\n    }\n  ],\n  \"messages\": []\n}\n" }

What might be going on?

Maybe try changing the “name” - multiple wrangler projects may need to be named separate things to work on the same CF account (not 100% on this though).

I am fairly certain that there is no other worker on my Cloudflare account by that name. In fact, if I remove the route value on wrangler.toml, the same script publishes just fine, to the .workers.dev subdomain.

I was missing the zone ID, and eventually this format worked:

name = "worker-name"
type = "webpack"
zone_id = "actual-zone-ID-here"
private = false
account_id = "actual-ID-here"
route = "workers.example.blog/*"
1 Like