-
Notifications
You must be signed in to change notification settings - Fork 178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Routes not displaying on refresh #32
Comments
Hi @mikebrits! You have to make sure your server serves the If you are using |
For a Rollup based dev environment generated from
from https://www.npmjs.com/package/sirv-cli
|
that is exactly what i was looking for as i am building single-page application dealing with firebase so i dont have a server.js file.. i just host the frontend files on firebase hosting. Please consider adding this to the docs :) |
PLEASE, Consider adding this to docs. This saved me. Thank you! |
It works well when we use npm but when I want to host it through apache web server, the issue still exists. I wish there is some hash-based routing to not manage the requests like at the server. I had a similar issue with react-router-dom and the hash router was useful. if there is something like that in svelte-routing, I would be happy. or else I need to move to svelte-spa-router |
I deployed my svelte-routing based app to an AWS S3 bucket, and was hitting the "404 No such key" issue upon routes navigation. After configuring the static website hosting settings (within the S3 bucket Properties) with index.html for both Index document and Error document, routes started working as expected, the "No such key" issue was solved for me, I hope it helps other S3 users if needed. |
Worked! Thanks! |
Thanks this worked for me |
I'm using webpack svelte template with svelte-routing, I tried to build and expose in apache server, having the issue : ) |
Hi guys! Like this: writeBundle() {
if (server) return;
server = require("child_process").spawn(
"npm",
["run", "start", "--", "--dev", "--single"],
{
stdio: ["ignore", "inherit", "inherit"],
shell: true,
}
);
process.on("SIGTERM", toExit);
process.on("exit", toExit);
},
}; Here is where I see that answer |
I was searching for local dev solution and this is it. Thank you! |
This 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 runnpm start
. When checking thepackage.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.
The text was updated successfully, but these errors were encountered: