Svelte HMR fails to reload page on Windows
See original GitHub issueDescribe the bug SvelteKit fails to reload page when navigate to page through address bar.
Logs
Failed to load resource: the server responded with a status of 404 (Not Found)
client:190 [hmr] Failed to reload D:\Dev\test\src\routes\page.svelte. This could be due to syntax errors or importing non-existent modules. (see errors above)
To Reproduce
- npm init svelte@next
- create any page in routes (ex. page.svelte)
- navigate to this page through address bar
- try modify page.svelte content
- sveltekit throws error 404 and page is not refresh / reloading.
I am using windows. Maybe it only windows related issue. Someone need check on other os.
Expected behavior
Stacktraces Information about your SvelteKit Installation:
Severity
Additional context
Issue Analytics
- State:
- Created 2 years ago
- Reactions:3
- Comments:28 (14 by maintainers)
Top Results From Across the Web
Svelte Hot Reloading Issue - Stack Overflow
Svelte 3 doesn't have hot reloading yet, but you could automatically refresh the browser on changes with e.g. the LiveReload Rollup plugin. In ......
Read more >svelte-hmr - npm
Start using svelte-hmr in your project by running `npm i svelte-hmr`. There are 22 other projects in the npm registry using svelte-hmr.
Read more >Getting Started with Svelte - Snowpack
Get started with this in-depth tutorial on how to build Svelte applications and websites with Snowpack.
Read more >Features | Vite
Frameworks with HMR capabilities can leverage the API to provide instant, precise updates without reloading the page or blowing away application state.
Read more >FAQ • SvelteKit
SvelteKit has HMR enabled by default powered by svelte-hmr. ... A side effect of this approach is that it takes longer to load...
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 FreeTop 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
Top GitHub Comments
My solution I used last time no longer seems to work and I have the same bug. Any further investigations would be appreciated.
This screenshot is indicative of some weird path combining, where it tries to combine the local path with the server route. Very strange.
don’t know if it will help further isolation of the problem but for me it was:
SomeComponent.svelte in libs folder, and by mistake I imported it as such;
my IDE didn’t say anything and component appeared as it should, but anytime I made changes to it, none were reflected unless I terminated npm run dev and ran it again. the moment I imported it correctly is when issue resolved itself.