How to reload/refresh current page
ndzeux opened this issue · 1 comments
I want reload my script, for example Home.svelte, in my case must reload Home.svelte
I try navigate does not work
How to do it ?
That's because when you refresh the page, your browser sends a request with a URL like /xxxxx
. This URL is processed by your web server but it leads to a 404 error as the only URL that does exist on your web server is /index.html.
In your dev/test environment you probably use sirv
, in that cas juste add -s
to the command line (for instance in your package.json), it will fallback all errors to index.html while keeping the correct URL. Then svelte-navigator will be abale to process the URL.
With a production web server like Apache or Nginx, you must to the same but the configuration is a bit more difficult but you will find a lot of example for react-router
that can be applied to svelte-navigator