sveltejs / svelte

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

next.168 broke unmounting content in my app #12247

Closed kjk closed 3 months ago

kjk commented 3 months ago

Describe the bug

things work with 167, after upgrading to 168 the following:

{#if showingNoteSelector}
  <Overlay onclose={closeNoteSelector} blur={true}>
    <NoteSelector
      {switchToCommandPalette}
      openNote={onOpenNote}
      createNote={onCreateNote}
      deleteNote={onDeleteNote}
    />
  </Overlay>
{/if}

stops working i.e. when showingNoteSelector goes from false to true, it does render the content as expected.

Going from true to false doesn't unmount the Overlay.

I have:

  $effect(() => {
    console.log("showingNoteSelector changed to:", showingNoteSelector);
  });

so I can tell that showingNoteSelector gets set to false but the Overlay remains on screen i.e. is not unmounted.

Reproduction

Verify that 167 works:

Verify that 168 breaks:

Dialog should get dismissed but isn't.

In console logs you should see a log that says showingNoteSelector changed to: false

The code in this particular scenario is closeNoteSelector() in App.svelte that simply does showingNoteSelector = false;

You can replace bun with equivalent npm or yarn commands.

Logs

No response

System Info

Windows 11, latest Chrome

Severity

blocking all usage of svelte

david-plugge commented 3 months ago

Can confirm, i was really confused when the Page just gut larger and larger when navigating.

Dudek-AMS commented 3 months ago

more minimal repo

https://www.sveltelab.dev/74y2hww9xufkrgl

seems to happen when you use a component in any route

dummdidumm commented 3 months ago

For everyone experiencing this: you can disable hot module reloading through the compilerOptions.hmr setting until this is fixed.

dummdidumm commented 3 months ago

Closing as duplicate of #12243

Dudek-AMS commented 3 months ago

@dummdidumm @Rich-Harris

still happens for me, when a route has +layout.server.ts

https://www.sveltelab.dev/vnsnqujbs0xif3c

check subfolder sysadmin/test

remove the file and it works