Routes not displaying on refresh
See original GitHub issueThis might be completely obvious, but it’s not clear from the readme as far as I can tell. I have created some links and routes, and everything is working fine, as long as I start the app at the root /
. If I navigate to a link, and then refresh the page, I get a Page Not Found error.
While I have been referencing the example, I’m still not sure why this is happening, except that I have a sneaky suspicion that it has something to do with the server.js
file mentioned in the readme. In the example it states that you should run npm start
. When checking the package.json
I noticed, that this runs a series of commands which will in essence be your server. The readme doesn’t mention having to do any of this.
I feel like I am missing something completely obvious here? And if I am not, how would this work in production? Thanks for your help.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:5
- Comments:11 (1 by maintainers)
Top GitHub Comments
For a Rollup based dev environment generated from
npx degit sveltejs/template my-svelte-project
, you can fix it by adding-s
to these 2 lines in package.jsonfrom https://www.npmjs.com/package/sirv-cli
Hi guys! The only thing that worked for was put
"--single"
insidewriteBundle
method inrollup.config.js
Like this:
Here is where I see that answer