Wrangler Pages file not found when serving a Qwik website

214 Views Asked by At

Wrangler version: 8.19.1

OS: Ubuntu 22.04.1 LTS

Bug

In my Qwik pages project, when running npm run build && npm run serve, some files failed to be found:

Full DevTools console output

127.0.0.1/:1 
 GET http://127.0.0.1:8788/build/q-8b482804.css net::ERR_ABORTED 404 (Not Found)
127.0.0.1/:1 
 GET http://127.0.0.1:8788/build/q-9f65a413.css net::ERR_ABORTED 404 (Not Found)
127.0.0.1/:1 
 GET http://127.0.0.1:8788/build/q-e6eff275.css net::ERR_ABORTED 404 (Not Found)
127.0.0.1/:1 
 GET http://127.0.0.1:8788/build/q-03a2bd7f.css net::ERR_ABORTED 404 (Not Found)
favicon.ico:1 
 GET http://127.0.0.1:8788/favicon.ico 404 (Not Found)
A bad HTTP response code (404) was received when fetching the script.
(index):3 TypeError: Failed to register a ServiceWorker for scope ('http://127.0.0.1:8788/') with script ('http://127.0.0.1:8788/service-worker.js'): A bad HTTP response code (404) was received when fetching the script.

Full terminal output

npm run serve                                                                                                                         [14:02:45]

> serve
> wrangler pages dev ./dist

 'wrangler pages <command>' is a beta command.
Compiling worker to "/tmp/functionsWorker-0.3009066340734492.js"...
Compiled Worker successfully.
▲ [WARNING] Passing --inspect is unnecessary, now you can always connect to devtools.

Starting inspector on 0.0.0.0:9229 failed: address already in use
GET / 200 OK (28.51ms)
GET /build/q-8b482804.css 404 Not Found (99.78ms)
GET /build/q-9f65a413.css 404 Not Found (69.33ms)
GET /build/q-e6eff275.css 404 Not Found (57.81ms)
GET /build/q-03a2bd7f.css 404 Not Found (57.55ms)
GET /service-worker.js 404 Not Found (53.69ms)
GET /favicon.ico 404 Not Found (61.71ms)

To try and fix this, I have updated entry.cloudflare-pages.tsx to use the new createQwikCity instead of the now deprecated qwikCity but this hasn't changed anything.

I've tried running npm run build.server before the serve, but no success either

I've double checked and the files are indeed inside my ./dist folder, they just fail to be found without further explanation.

FYI when running npm run dev my website works as expected

0

There are 0 best solutions below