Skip to content
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

Svelte 5: Hot Reload not working with included component #12403

Closed
gemue-parndt opened this issue Jul 11, 2024 · 9 comments
Closed

Svelte 5: Hot Reload not working with included component #12403

gemue-parndt opened this issue Jul 11, 2024 · 9 comments
Labels
Milestone

Comments

@gemue-parndt
Copy link

gemue-parndt commented Jul 11, 2024

Describe the bug

Hot Reload is not working if a component is mounted into a +page.svelte.
When editing the mounted compontent and i.e. change a text or add a div the component is going to disappear in the browser. In order to show the component again one have to reload the browser page.

In case the code of the component is directly written into the +page.svelte file it's working as intended. One can change the code on the +page.svelte and it reloads the desired place.

Reproduction

I've created the following example to reproduce the bug.
On the root route / there is the mounted component causing the bug.
On the /example route the component code is directly written into the +page.svelte not producing any issues.

reproduction.zip

EDIT: Works in 5.0.0-next.178 and breaks in 5.0.0-next.179

Logs

-

System Info

System:
    OS: Windows 11 10.0.22621
    CPU: (28) x64 13th Gen Intel(R) Core(TM) i7-13850HX
    Memory: 10.17 GB / 31.69 GB
  Binaries:
    bun: 1.1.18 - ~\.bun\bin\bun.EXE
  Browsers:
    Edge: Chromium (126.0.2592.87)
  npmPackages:
    svelte: ^5.0.0-next.181 => 5.0.0-next.181

Severity

annoyance

@dummdidumm dummdidumm added this to the 5.0 milestone Jul 12, 2024
@dummdidumm dummdidumm added the bug label Jul 12, 2024
@PudottaPommin
Copy link

In my project on 178 it's working as expected, and stopped with version 179 onwards

@HummingMind
Copy link

In my project on 178 it's working as expected, and stopped with version 179 onwards

Same here. 178 works, 179+ breaks.

@HummingMind
Copy link

@Rich-Harris Hello Rich Would it be possible to get a fix for this one into next.186? Makes it rather difficult to dev with Svelte 5 RC. 😢

Thank you! 🍻

@Rich-Harris
Copy link
Member

You can pin to an older version until we get a chance to fix it

@HummingMind
Copy link

Not sure what changed, but this is now working fine for me. I don't think it was a fix in svelte5 itself, as I tested with versions where this was still happening. I am guessing some other package received the fix?

@AlbertMarashi
Copy link

@HummingMind are you sure?

@dummdidumm
Copy link
Member

Fixed by #12575

@HummingMind
Copy link

@HummingMind are you sure?

It did on my desktop. I am about to go on my laptop in 30 minutes, I'll see what happens there.

@HummingMind
Copy link

@HummingMind are you sure?

Yes. Looks like 197 fixed it, as @dummdidumm mentioned above.

The reason I thought older versions worked, because I forgot I was using ^ in my devDependencies for Svelte, so I was changing the version numbers but npm was always using 197. 😆

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants