cloudflare / cloudflare/workers-sdk

wrangler deploy reports a zone route as deployed without creating it (pattern host is a Cloudflare for SaaS custom hostname)

Open
#15,464 1 comment 0 reactions 0 assignees View on GitHub
package:wrangler
Dominant language
TypeScript
Stars
4.5k
Forks
1.5k
Avg merge
3d 8h
Merged PRs (30d)
187

Description

### Which Cloudflare product(s) does this pertain to?

Wrangler

### What versions are you using?

wrangler 4.124.0, macOS (darwin arm64)

### Describe the bug

`wrangler deploy` listed a zone route among the deployed triggers, but the route was never created in the zone. No warning or error was printed. Requests to the hostname kept bypassing the Worker until the identical route was added manually in the dashboard, which fixed it immediately.

Config (`wrangler.jsonc`):

```jsonc
"routes": [
{ "pattern": "blog-hello-coop.aauth.dev", "custom_domain": true },
{ "pattern": "blog.hello.coop/*", "zone_name": "aauth.dev" }
]
```

The relevant detail: `blog.hello.coop` is a **Cloudflare for SaaS custom hostname** on the `aauth.dev` zone (the pattern's hostname is outside the zone's apex and has no DNS record in the zone — that's why `zone_name` is specified explicitly, per the docs). This is the documented way to run a Worker on SaaS custom-hostname traffic, since a Workers Custom Domain does not intercept it (the Host header stays the custom hostname).

### Observed

- `wrangler deploy` output listed `blog.hello.coop/* (zone name: aauth.dev)` under the deployed triggers and exited 0.
- The zone's Workers Routes page showed no such route, and traffic to `blog.hello.coop` did not reach the Worker.
- Creating the same route (`blog.hello.coop/*` → the Worker) via dashboard made everything work; subsequent deploys now list the route and it keeps working.

### Expected

Either the route is created, or the deploy fails/warns loudly. Printing the route as a deployed trigger while it doesn't exist in the zone means the failure is only discoverable by probing the hostname — this cost us a chunk of a production cutover.

I can't re-reproduce destructively on this zone (it's serving production traffic now), so I can't say whether the API call failed silently or was never made; happy to provide account/zone IDs privately or run diagnostics that don't require deleting the working route.

Contributor guide

Open the contributing guide

Research direction

Start by tracing how `wrangler deploy` handles the `routes` in `wrangler.jsonc`, especially the route with `zone_name` whose hostname is a Cloudflare for SaaS custom hostname. Compare what deploy reports with whether the route is actually created in the zone; done means the route is created or deploy clearly warns or fails when it is not.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.