🐛 BUG: with a custom route defined, `wrangler dev` tries to request data from the wrong host when starting up
See original GitHub issueWhat version of Wrangler
are you using?
2.0.3
What operating system are you using?
Mac
Describe the Bug
- I have a route defined like so:
routes = [{ pattern = "*foo.bar.com/*", zone_name = "bar.com" }]
- I start up
wrangler dev
- Wrangler tries to request
bar.com/cdn-cgi/workers/preview
, notfoo.bar.com
- Wrangler dies with
✘ [ERROR] Error on remote worker: SyntaxError: Unexpected token < in JSON at position 0
as it blindly tries to parse the incoming HTML from the wrong host as JSON.
Notes:
wrangler dev
works if I remove the routewrangler dev --local
worksfoo.bar.com
is routed to192.0.2.1
in the DNS settings, and proxied through CFbar.com
is routed to another public IP, and not proxied
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:11 (7 by maintainers)
Top Results From Across the Web
dev needs to support for custom routes #1529 - GitHub
Since Wrangler dev is now using a proxy through custom routes we need the ability to identify custom routes. Right now it requires...
Read more >Deprecations · Cloudflare Workers docs
Deprecations. This document describes the difference between Wrangler 1 and 2, specifically deprecations and breaking changes.
Read more >ssl - CloudFlare workers fetch HTTPS works on workers.dev ...
The DNS works fine the URL is reachable, but when I try to hit https://foo.mydomain.com/myEndpoint CloudFlare's worker logs show that the fetch ...
Read more >Wrangler | Noise
TypeScript makes it easy for developers to write code that doesn't crash, by catching type errors before your program runs. We want developers...
Read more >Using the CLI - Miniflare
It lets you start a local HTTP server that serves requests using your worker. Tip. If you'd like to try out a zero-configuration...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
A workaround for now is to add this to your
wrangler.toml
:Closing this issue, we released 2.0.16 that includes the probable fix, but happy to reopen if this issue persists.