Skip to content

Commit 2348d5a

Browse files
WC-4172 Document worker naming limitations, including subdomains (#26350)
1 parent be910cc commit 2348d5a

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

src/content/docs/workers/configuration/routing/workers-dev.mdx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,22 @@ If you do not specify `workers_dev = false` but add a [`routes` component](/work
7373
If you disable your `workers.dev` route in the Cloudflare dashboard but do not update your Worker's Wrangler file with `workers_dev = false`, the `workers.dev` route will be re-enabled the next time you deploy your Worker with Wrangler.
7474
:::
7575

76+
## Limitations
77+
78+
When deploying a Worker with a `workers.dev` subdomain enabled, your Worker name must meet the following requirements:
79+
80+
- Must be 63 characters or less
81+
- Must contain only alphanumeric characters (`a-z`, `A-Z`, `0-9`) and dashes (`-`)
82+
- Cannot start or end with a dash (`-`)
83+
84+
These restrictions apply because the Worker name is used as a DNS label in your `workers.dev` URL. DNS labels have a maximum length of 63 characters and cannot begin or end with a dash.
85+
86+
:::note
87+
88+
Worker names can be up to 255 characters when not using a `workers.dev` subdomain. If you need a longer name, you can disable `workers.dev` and use [routes](/workers/configuration/routing/routes/) or [custom domains](/workers/configuration/routing/custom-domains/) instead.
89+
90+
:::
91+
7692
## Related resources
7793

7894
- [Announcing `workers.dev`](https://blog.cloudflare.com/announcing-workers-dev)

src/content/docs/workers/wrangler/configuration.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ The `main` key is optional for assets-only Workers.
100100
:::
101101

102102
- `name` <Type text="string" /> <MetaInfo text="required" />
103-
- The name of your Worker. Alphanumeric characters (`a`,`b`,`c`, etc.) and dashes (`-`) only. Do not use underscores (`_`).
103+
- The name of your Worker. Alphanumeric characters (`a`,`b`,`c`, etc.) and dashes (`-`) only. Do not use underscores (`_`). Worker names can be up to 255 characters. If you plan to use a [`workers.dev` subdomain](/workers/configuration/routing/workers-dev/), the name must be 63 characters or less and cannot start or end with a dash.
104104

105105
- `main` <Type text="string" /> <MetaInfo text="required" />
106106
- The path to the entrypoint of your Worker that will be executed. For example: `./src/index.ts`.

0 commit comments

Comments
 (0)