-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
HMR reorders content #6506
Comments
Could you try with Svelte version 3.38.2? It's just a rough guess, but maybe this is a result of the new hydration optimization in 3.38.3
|
@dummdidumm that fixed it! |
@benmccann I believe that the issue might lie in svelte-hmr here https://github.com/rixo/svelte-hmr/blob/master/runtime/proxy-adapter-dom.js#L53 . I believe that svelte's |
(Since the issue is not caused by a bug in hydration, I don't think reverting the hydration PR would be ideal. If svelte-hmr cannot be fixed in time, a quick fix might be to disable hydration in dev mode where I believe HMR is used, since it is the interaction between the two that seems to cause the issue) |
Thanks for the deep dive @hbirler . I'll take a closer look. |
The fix suggested by @hbirler seems correct to me, and local tests seems to confirm that it works for me. I'm not sure whether This change should normally have no effect when used with Svelte <3.38.3 so it should probably be a patch version for |
To keep the ball rolling, I released the fix (using |
please update vite-plugin-svelte to [email protected] and try again, |
I'll mark this as closed so that we don't forget to, but let us know if there are any issues |
Describe the bug
When saving a component in the latest version of Kit.
To Reproduce
Repro repo:
https://github.com/danawoodman/sveltekit-content-jump-bug/tree/main
npm init svelte@next foo cd foo npm i npm run dev
Then create a file with a few components, change a component and watch it jump to the bottom.
Expected behavior
Should reload without content jumping around.
Information about your SvelteKit Installation:
Diagnostics
Severity
This really messes up local development since you'll need to reload every time to get the proper layout to show up.
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: