wrangler-legacy icon indicating copy to clipboard operation
wrangler-legacy copied to clipboard

wrangler dev Error: HTTP status client error (404 Not Found) for url

Open razvanstatescu opened this issue 4 years ago • 10 comments

🐛 Bug Report

I try to run wrangler dev but I get this error "Error: HTTP status client error (404 Not Found) for url"

In my wrangler.toml I have route set (if that help)

Environment

  • operating system: MacOS Catalina
  • output of node -v: 13.14.0
  • output of wrangler -V: 1.11.0
  • contents of wrangler.toml name = "proxy" type = "webpack" account_id = "" route = "" zone_id = "" webpack_config = "webpack.config.js"

Steps to reproduce

What did you expect to see?

What did you see instead?

razvanstatescu avatar Oct 05 '20 15:10 razvanstatescu

If you don't provide a route, workers_dev = true must be in your wrangler.toml

nataliescottdavidson avatar Oct 06 '20 16:10 nataliescottdavidson

@nataliescottdavidson I provided a route (I just removed it now, when I posted the config file). The worker is working as expected in production. I just can't use the dev command because I get that error.

razvanstatescu avatar Oct 06 '20 16:10 razvanstatescu

Ok, if you have a route set you must have that route on Cloudflare and get the zone_id from your dash.cloudflare.com.

nataliescottdavidson avatar Oct 06 '20 16:10 nataliescottdavidson

@nataliescottdavidson I have the config completed (I just removed some details from it when I posted it here). I also have the route on cloudflare. But when I run the dev command I get Error: HTTP status client error (404 Not Found) for url

razvanstatescu avatar Oct 06 '20 16:10 razvanstatescu

What's your wrangler publish output?

nataliescottdavidson avatar Oct 07 '20 14:10 nataliescottdavidson

Guys, I also have the same problem.

The whole process to clone Github, create and adjust the project works perfectly, the problem occurs only when you define a route and publish the version in CloudFlare, it simply does not work accessing the route.

When trying to access the link inserted in the route, it simply falls directly on page 404. I can only access the project through the temporary link (dev).

Any solution for that?

  • operating system: Windows 10 build 2004
  • output of wrangler -V: 1.11.0

wrangler.toml : name = "guias" type = "webpack" account_id = "d740...." workers_dev = false route = "www.viaagenciadigital.com.br/teste1" zone_id = "3a2c..."

[site] bucket = "./public"

NOTE: I activated the debug, in the script, and is presenting this message: could not find teste1 / index.html in your content namespace

DEV URL: https://guias.viadigital.workers.dev/

wmosquini avatar Oct 27 '20 14:10 wmosquini

In the default worker sites you get a worker with a try...catch block in the handleEvent(). If you changed something in there, it's possible that your try has an error and that is why you're getting those 404's.

rslonik avatar Mar 02 '21 10:03 rslonik

This issue has been automatically marked as stale because it has not had recent activity in the last 180 days. It will be closed if no further activity occurs in the next week. Please feel free to comment if you'd like it to remain open, and thank you for your contributions.

stale[bot] avatar Sep 19 '21 20:09 stale[bot]

I have the same error: Error: HTTP status client error (404 Not Found) for url (https://DOMAIN.com/cdn-cgi/workers/preview/?s0=LONG_STRING)

My wrangler.toml:

name = "workername" type = "webpack" account_id = "ACCOUNT_ID" workers_dev = false route = "https://SUBDOMAIN.DOMAIN.com/*" zone_id = "ZONE_ID"

kv-namespaces = [ { binding = "KV_STORE_NAME", id = "KV_ID", preview_id = "KV_ID" } ]

[site] bucket = "./public"

Note that my error's URL doesn't have the subdomain as defined in the route.

macOS 11.6 Wrangler 1.19.3

wrangler preview loads a browser preview as expected. Just wrangler dev seems to be broken in this way. wrangler publish works fine.

jtilford avatar Sep 22 '21 23:09 jtilford

Issue still persist and wrangler preview can't be used with modules

╰─ wrangler preview        
Error: wrangler preview does not support previewing modules scripts. Please use wrangler dev instead.

Mistic92 avatar Apr 11 '22 11:04 Mistic92

I can confirm that wrangler dev is indeed broken somehow. In my machine, it's broken too.

Honestly, wrangler2 is no better.

medmin avatar Oct 27 '22 03:10 medmin

👋 Thanks for reporting this issue! Wrangler v1 is now deprecated and support is only being provided for critical updates or security concerns. As such, we are closing this issue.

New versions of Wrangler are maintained in the workers-sdk repo. If you are running into a similar issue with wrangler v2, please report it in the workers-sdk repo. For more info about wrangler v1 deprecation, please check out our blog post.


@medmin, is there a specific issue you're seeing with wrangler v2? Would you be able to open a GitHub issue on the workers-sdk repo?

mrbbot avatar Feb 27 '23 16:02 mrbbot