Skip to content

Commit 08b502b

Browse files
fix: Don't crash on hydratable serialization failures
1 parent 46603d9 commit 08b502b

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

.changeset/two-lizards-poke.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'svelte': patch
3+
---
4+
5+
fix: Don't crash on hydratable serialization failure

packages/svelte/src/internal/server/hydratable.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,11 @@ function encode(key, value, unresolved) {
7878
const placeholder = `"${uid++}"`;
7979

8080
(entry.promises ??= []).push(
81-
p.then((s) => {
82-
entry.serialized = entry.serialized.replace(placeholder, s);
83-
})
81+
p
82+
.then((s) => {
83+
entry.serialized = entry.serialized.replace(placeholder, s);
84+
})
85+
.catch(() => {})
8486
);
8587

8688
return placeholder;

0 commit comments

Comments
 (0)