sveltejs / svelte

Cybernetically enhanced web apps
https://svelte.dev
MIT License
78.68k stars 4.12k forks source link

HMR fails on next.179 and above #12565

Closed propolies closed 2 months ago

propolies commented 2 months ago

Describe the bug

The component dissapears after making any changes.

Reproduction

<script lang='ts'>
  // +page.svelte
  import Input from "$lib/components/input.svelte"
</script>

<Input />
<!-- $lib/components/input.svelte -->
<input />

<div>1</div>

To reproduce simply add or remove a div in the component and the component will dissapear and need to be reloaded manually.

Logs

No response

System Info

vscode, next.179 and above

Severity

annoyance

dominikg commented 2 months ago

Have you tried with svelte@5.0.0-next.195 ? that fixed one HMR bug that matches your description.

Please always provide a link to a reproduction repo, so questions like mine above are answered by looking at the package.json/lockfile.

propolies commented 2 months ago

My bad https://github.com/propolies/hmr-reproduction, and yes tested on svelte@5.0.0-next.195. Found out it happens with every element, not just input

Devr-pro commented 2 months ago

Facing same behavior.

ottomated commented 2 months ago

I think this is the same bug as #12554?

subzero79 commented 2 months ago

I was waiting for release 195 to fix it but didn't happen. HMR works at page level(sveltekit) changes, but fails at component changes.

itsmikesharescode commented 2 months ago

same here experiencing the same but with all shadcn component when i save my changes i have to manually reload it :/

itsmikesharescode commented 2 months ago

ohh its actually working now in me with version 196

dummdidumm commented 2 months ago

Closing as duplicate of #12417, which was fixed