mirror of https://github.com/sveltejs/svelte
fix: bypass error boundaries for hydration recovery (#18841)
Fixes #18840 This PR rethrows the hydration error rather than catching it at the boundaries so that the svelte hydration warning can surface ### Before submitting the PR, please make sure you do the following - [x] It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs - [x] Prefix your PR title with `feat:`, `fix:`, `chore:`, or `docs:`. - [x] This message body should clearly illustrate what problems it solves. - [x] Ideally, include a test that fails without this PR but passes with it. - [x] If this PR changes code within `packages/svelte/src`, add a changeset (`npx changeset`). ### Tests and linting - [x] Run the tests with `pnpm test` and lint the project with `pnpm lint` --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>pull/18821/merge
parent
803f59b171
commit
325620ba63
@ -0,0 +1,5 @@
|
||||
---
|
||||
'svelte': patch
|
||||
---
|
||||
|
||||
fix: prevent hydration mismatch recovery from being intercepted by error boundaries
|
||||
@ -0,0 +1,5 @@
|
||||
import { test } from '../../test';
|
||||
|
||||
export default test({
|
||||
expect_hydration_error: true
|
||||
});
|
||||
@ -0,0 +1 @@
|
||||
<!----><p><p>Valid HTML fragment</p><!----></p><!---->
|
||||
@ -0,0 +1,7 @@
|
||||
<svelte:boundary>
|
||||
<p>{@html '<p>Valid HTML fragment</p>'}</p>
|
||||
|
||||
{#snippet failed()}
|
||||
<p>boundary fallback</p>
|
||||
{/snippet}
|
||||
</svelte:boundary>
|
||||
Loading…
Reference in new issue