mirror of https://github.com/sveltejs/svelte
fix: ensure `<svelte:boundary>` properly removes error content in production mode (#15793)
* fix: ensure <svelte:boundary> properly removes error content in production mode * add changesetpull/15800/head
parent
3d80884029
commit
b2d5787a09
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
'svelte': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
fix: ensure <svelte:boundary> properly removes error content in production mode
|
@ -0,0 +1,3 @@
|
|||||||
|
<script>
|
||||||
|
throw new Error();
|
||||||
|
</script>
|
@ -0,0 +1,11 @@
|
|||||||
|
import { flushSync } from 'svelte';
|
||||||
|
import { test } from '../../test';
|
||||||
|
|
||||||
|
export default test({
|
||||||
|
mode: ['client'],
|
||||||
|
test({ assert, target }) {
|
||||||
|
flushSync();
|
||||||
|
|
||||||
|
assert.htmlEqual(target.innerHTML, '<p>error occurred</p>');
|
||||||
|
}
|
||||||
|
});
|
@ -0,0 +1,15 @@
|
|||||||
|
<script>
|
||||||
|
import Child from "./Child.svelte"
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<svelte:boundary>
|
||||||
|
<p>This should be removed</p>
|
||||||
|
|
||||||
|
{#if true}
|
||||||
|
<Child />
|
||||||
|
{/if}
|
||||||
|
|
||||||
|
{#snippet failed()}
|
||||||
|
<p>error occurred</p>
|
||||||
|
{/snippet}
|
||||||
|
</svelte:boundary>
|
Loading…
Reference in new issue