-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Closed
Description
Describe the bug
When an error occurs inside #if block within an <svelte:boundary>, there is a bug where the remaining elements are not removed and remain visible.
This issue doesn't occur in the development environment but only happens in the production build. (NODE_ENV=production)
<svelte:boundary>
<div>This should be removed</div>
{#if true}
<ErrorComponent /> <!-- This throws an error -->
{/if}
{#snippet failed()}
<div>error boundary</div>
{/snippet}
</svelte:boundary>Reproduction
https://stackblitz.com/edit/vitejs-vite-zvok4jqx?file=src%2FApp.svelte
You can reproduce this issue by running:
NODE_ENV=production npm run dev or npm run build && npm run preview
Logs
System Info
System:
OS: macOS 15.1
CPU: (14) arm64 Apple M3 Max
Memory: 2.69 GB / 36.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 22.13.0 - ~/.local/state/fnm_multishells/49337_1743582171802/bin/node
Yarn: 1.22.22 - ~/.local/state/fnm_multishells/49337_1743582171802/bin/yarn
npm: 10.9.2 - ~/.local/state/fnm_multishells/49337_1743582171802/bin/npm
pnpm: 9.15.0 - ~/.local/state/fnm_multishells/49337_1743582171802/bin/pnpm
Browsers:
Chrome: 134.0.6998.166
Safari: 18.1
npmPackages:
svelte: ^5.20.2 => 5.25.6Severity
annoyance
minkky, blueooh and kakao-grant-leeminkky
Metadata
Metadata
Assignees
Labels
No labels