Getting 404 error during "npm run build", but not "npm run dev" (simple static adapter website)
See original GitHub issueDescribe the bug
After a recent npm update (which I’m assuming updated Svelte, but correct me if I’m wrong), I’ve started getting a 404 error when attempting to do a release build. It doesn’t happen when I do a preview build (see attached image).
My site is a very simple static webpage (using adapter-static). No stub routing, no spaces in image filenames, etc.
Reproduction
See files I’ve attached here. Since this error occurs at build time (and not during website usage), I’m not sure how to respond to this.
My website is proprietary and thus not on Github. I can send the full repository to a Svelte maintainer via ProtonMail if necessary. Please advise.
Logs
I'm not sure what logs to include. If you need any, please advise. Thank you in advance for your help...
System Info
System:
OS: Linux 5.10 Ubuntu 18.04.6 LTS (Bionic Beaver)
CPU: (4) x64 Intel(R) Core(TM) i7-6500U CPU @ 2.50GHz
Memory: 3.90 GB / 6.08 GB
Container: Yes
Shell: 4.4.20 - /bin/bash
Binaries:
Node: 16.4.1 - ~/.nvs/node/16.4.1/x64/bin/node
npm: 7.18.1 - ~/.nvs/node/16.4.1/x64/bin/npm
npmPackages:
@sveltejs/adapter-static: ^1.0.0-next.13 => 1.0.0-next.21
@sveltejs/kit: next => 1.0.0-next.201
svelte: ^3.34.0 => 3.44.2
Severity
blocking an upgrade
Additional Information
No response
Issue Analytics
- State:
- Created 2 years ago
- Reactions:4
- Comments:21 (4 by maintainers)
Top Results From Across the Web
I get 404 error in the localhost even though I already did "npm ...
When I run the command "SET NODE_ENV = production node server.js" (I'm in Windows, that's why SET) and I go to the localhost...
Read more >npm-publish - npm Docs
Description. Publishes a package to the registry so that it can be installed by name. By default npm will publish to the public...
Read more >How to Build a Fullstack App with Next.js, Prisma, and ... - Vercel
Find a specific post based on the ID. That's it! If your app is not running any more, you can restart it with...
Read more >404: React Page Not Found - Karen Ying
When you run npm run build , Webpack bundles and minifies all your organized code into the build folder in your root directory....
Read more >base-front-ts - npm Package Health Analysis - Snyk
This way, when you fetch('/api/todos') in development, the development server will recognize that it's not a static asset, and will proxy your ...
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 Free
Top 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
Sorry, got a lot busy recently, but thanks for tracking this down! That means something in v200 failed, which is likely #2832. If someone wants to help out, feel free to debug that PR.
I also got problems after #2832, in my case it is a combination of the following:
www.domain.com/test. I have added/testas base path and page/asset paths in svelte-config./test/page1/test/page1), but it cannot find it, since it’s actually positioned at/page1during the build process.I added a work-around, by adding an extra empty route at
/test/page1, which ‘works’ but it would be preferable if either: