Skip to content

Commit 84eca42

Browse files
authored
fix: don't hydrate when falling back to error page (#13056)
1 parent d660ff4 commit 84eca42

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

.changeset/funny-lies-beam.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@sveltejs/kit': patch
3+
---
4+
5+
fix: don't hydrate when falling back to error page

packages/kit/src/runtime/client/client.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2358,6 +2358,7 @@ async function _hydrate(
23582358

23592359
/** @type {import('./types.js').NavigationFinished | undefined} */
23602360
let result;
2361+
let hydrate = true;
23612362

23622363
try {
23632364
const branch_promises = node_ids.map(async (n, i) => {
@@ -2422,13 +2423,16 @@ async function _hydrate(
24222423
url,
24232424
route
24242425
});
2426+
2427+
target.textContent = '';
2428+
hydrate = false;
24252429
}
24262430

24272431
if (result.props.page) {
24282432
result.props.page.state = {};
24292433
}
24302434

2431-
initialize(result, target, true);
2435+
initialize(result, target, hydrate);
24322436
}
24332437

24342438
/**

0 commit comments

Comments
 (0)