Wrangler Pages file not found when serving a Qwik website - javascript

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

Related

Error while importing JQuery library net::ERR_Aborted 404

Working on a Java project in eclipse ide. I downloaded and added jQuery library in my Web/module_name/WebContent/js folder. In my code I have imported the file as:
<script src="/module_name/js/jquery-1.12.4.js"></script>
When I run the server, I am getting error as net::ERR_Aborted 404 and the address in the error line is showing as:
GET http://localhost:8080/module_name/js/jquery-1.12.4.js net::ERR_ABORTED 404

Why does my localhost:3000 not work (error 500)

I am trying to follow a tutorial but i run into problems before i even have written a line of code. only terminal commands as seen below:
*PS C:\Users\ruben\OneDrive\Bureaublad\dapp> cd .\client\
PS C:\Users\ruben\OneDrive\Bureaublad\dapp\client> npm init vite#latest
√ Project name: ... ./
√ Select a framework: » react
√ Select a variant: » react
Scaffolding project in C:\Users\ruben\OneDrive\Bureaublad\dapp\client\...
Done. Now run:
npm install
npm run dev
PS C:\Users\ruben\OneDrive\Bureaublad\dapp\client> npm install
added 76 packages, and audited 77 packages in 6s
7 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
PS C:\Users\ruben\OneDrive\Bureaublad\dapp\client> npm run dev
> dapp1#0.0.0 dev
> vite
Pre-bundling dependencies:
react
react-dom
react/jsx-dev-runtime
(this will be run only when your dependencies or config have changed)
vite v2.7.10 dev server running at:
> Local: http://localhost:3000/
> Network: use `--host` to expose
ready in 467ms.*
When i go to the localhost i get presented a blank page (in the tutorial it shows a visual and some text.
When i inspect the page i get presented by there errors:
:3000/:1
GET http://localhost:3000/ 500 (Internal Server Error)
localhost/:1
GET http://localhost:3000/_next/static/chunks/fallback/webpack.js?ts=1641050312655
net::ERR_ABORTED 500 (Internal Server Error)
localhost/:1
GET http://localhost:3000/_next/static/chunks/fallback/main.js?ts=1641050312655
net::ERR_ABORTED 500 (Internal Server Error)
localhost/:1
GET http://localhost:3000/_next/static/chunks/fallback/react-refresh.js?
ts=1641050312655 net::ERR_ABORTED 500 (Internal Server Error)
localhost/:1
GET http://localhost:3000/_next/static/chunks/fallback/pages/_app.js?
ts=1641050312655 net::ERR_ABORTED 500 (Internal Server Error)
localhost/:1
GET http://localhost:3000/_next/static/chunks/fallback/pages/_error.js?
ts=1641050312655 net::ERR_ABORTED 500 (Internal Server Error)
Aswel as this issue:
A page or script is accessing at least one of navigator.userAgent, navigator.appVersion, and navigator.platform. Starting in Chrome 101, the amount of information available in the User Agent string will be reduced.
To fix this issue, replace the usage of navigator.userAgent, navigator.appVersion, and navigator.platform with feature detection, progressive enhancement, or migrate to navigator.userAgentData.
Note that for performance reasons, only the first access to one of the properties is shown.
1 source
bubble_compiled.js:1
This could be a permission issue. You are working inside OneDrive folder. So there is a probability that OneDrive is constantly watching every change inside the inner folders and blocking access for other applications. Try starting your project anew in another folder. Preferably in 'C:\Users\ruben\Desktop'.
Make sure that you are using at least npm v6 i just tried this on node v17 and it is working fine on npm v7.
The docs that i followed is here

Failed to load resource error after using a bundler

I was finally able to import and use axios by installing a bundler (parcel bundler). I configured it, but now when I run the server I receive an "Failed to load resource: the server responded with a status of 404 (Not Found)" error for localhost/:1, which takes me to the first line of index.html in the inspect window after I click it.
Some pictures to clarify:
This is strange because the website loads and is visible (which wouldn't have been possible if it couldn't load index.html as that is what is being shown) so maybe I am not getting right what this error even means.

Magento - frontend and backend don't have js files

I installed the magento2 project for the first time.
I installed the "luma" template and made the following commands:
bin/magento sampledata:deploy
bin/magento setup:upgrade
bin/magento deploy:mode:set developer
php bin/magento setup:static-content:deploy -f
Unfortunately, I still have a problem with reading js files on the front (both frontend and backend).
GET http://magento.local/static/version1547468917/frontend/Magento/luma/en_US/mage/requirejs/mixins.js net::ERR_ABORTED 404 (Not Found)
(index):22 GET http://magento.local/static/version1547468917/frontend/Magento/luma/en_US/requirejs/require.js net::ERR_ABORTED 404 (Not Found)
(index):25 GET http://magento.local/static/version1547468917/frontend/Magento/luma/en_US/mage/polyfill.js net::ERR_ABORTED 404 (Not Found)
(index):23 GET http://magento.local/static/version1547468917/frontend/Magento/luma/en_US/mage/requirejs/mixins.js net::ERR_ABORTED 404 (Not Found)
(index):25 GET http://magento.local/static/version1547468917/frontend/Magento/luma/en_US/mage/polyfill.js 404 (Not Found)
(index):65 Uncaught TypeError: require.config is not a function
at (index):65
I've tried different solutions. Can any of you help me? This is my first magento project.

Jhipster - 404 error on app.js when running in prod profile

I have a problem running my jhipster application in prod. After the deployment of prod war file the site is unable to load due to a 404 not found on /app/app.js
However vendor js and css are correctly injected. Not sure what's causing this issue.
Error message :
Failed to load resource: the server responded with a status of 404 (Not Found)
generated.js:19530
Uncaught TypeError: Cannot read property 'module' of undefined(…)
http://localhost:9080/app/app.js
Failed to load resource: the server responded with a status of 404 (Not Found)
Error as seen in the browser's console:
did you also build your app for prod? it looks like your app did not build the client site. This is done actually wiht the gulp build command. Depending on your build system maven or gradle you can specify the prod environment for the build phase, e.g. for maven mvn -Pprod package.
The gulp build command will be automatically executed durring the build phase. In the doc you can find more information about how to use JHipster in production.

Categories