Skip to content

Commit 3c36c7e

Browse files
tweak
1 parent b5f2143 commit 3c36c7e

File tree

4 files changed

+14
-10
lines changed

4 files changed

+14
-10
lines changed

documentation/docs/98-reference/.generated/server-errors.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ The `html` property of server render results has been deprecated. Use `body` ins
1717
### hydratable_clobbering
1818

1919
```
20-
Attempted to set hydratable with key `%key%` twice with different values.
20+
Attempted to set `hydratable` with key `%key%` twice with different values.
2121
2222
First instance occurred at:
2323
%stack%
@@ -44,7 +44,7 @@ This error occurs when using `hydratable` multiple times with the same key. To a
4444
### hydratable_serialization_failed
4545

4646
```
47-
Failed to serialize `hydratable` data.
47+
Failed to serialize `hydratable` data for key `%key%`.
4848
4949
`hydratable` can serialize anything [`uneval` from `devalue`](https://npmjs.com/package/uneval) can, plus Promises.
5050

packages/svelte/messages/server-errors/errors.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ You (or the framework you're using) called [`render(...)`](svelte-server#render)
1010
1111
## hydratable_clobbering
1212

13-
> Attempted to set hydratable with key `%key%` twice with different values.
13+
> Attempted to set `hydratable` with key `%key%` twice with different values.
1414
>
1515
> First instance occurred at:
1616
> %stack%
@@ -35,7 +35,7 @@ This error occurs when using `hydratable` multiple times with the same key. To a
3535

3636
## hydratable_serialization_failed
3737

38-
> Failed to serialize `hydratable` data.
38+
> Failed to serialize `hydratable` data for key `%key%`.
3939
>
4040
> `hydratable` can serialize anything [`uneval` from `devalue`](https://npmjs.com/package/uneval) can, plus Promises.
4141
>

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export function html_deprecated() {
2727
}
2828

2929
/**
30-
* Attempted to set hydratable with key `%key%` twice with different values.
30+
* Attempted to set `hydratable` with key `%key%` twice with different values.
3131
*
3232
* First instance occurred at:
3333
* %stack%
@@ -40,7 +40,7 @@ export function html_deprecated() {
4040
* @returns {never}
4141
*/
4242
export function hydratable_clobbering(key, stack, stack2) {
43-
const error = new Error(`hydratable_clobbering\nAttempted to set hydratable with key \`${key}\` twice with different values.
43+
const error = new Error(`hydratable_clobbering\nAttempted to set \`hydratable\` with key \`${key}\` twice with different values.
4444
4545
First instance occurred at:
4646
${stack}
@@ -54,17 +54,18 @@ ${stack2}\nhttps://svelte.dev/e/hydratable_clobbering`);
5454
}
5555

5656
/**
57-
* Failed to serialize `hydratable` data.
57+
* Failed to serialize `hydratable` data for key `%key%`.
5858
*
5959
* `hydratable` can serialize anything [`uneval` from `devalue`](https://npmjs.com/package/uneval) can, plus Promises.
6060
*
6161
* Stack:
6262
* %stack%
63+
* @param {string} key
6364
* @param {string} stack
6465
* @returns {never}
6566
*/
66-
export function hydratable_serialization_failed(stack) {
67-
const error = new Error(`hydratable_serialization_failed\nFailed to serialize \`hydratable\` data.
67+
export function hydratable_serialization_failed(key, stack) {
68+
const error = new Error(`hydratable_serialization_failed\nFailed to serialize \`hydratable\` data for key \`${key}\`.
6869
6970
\`hydratable\` can serialize anything [\`uneval\` from \`devalue\`](https://npmjs.com/package/uneval) can, plus Promises.
7071

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,10 @@ function encode(key, value, values, unresolved) {
6969
const serialize_promise = value
7070
.then(scoped_uneval)
7171
.catch((devalue_error) =>
72-
e.hydratable_serialization_failed(serialization_stack(entry.stack, devalue_error?.stack))
72+
e.hydratable_serialization_failed(
73+
key,
74+
serialization_stack(entry.stack, devalue_error?.stack)
75+
)
7376
);
7477
serialize_promise.catch(() => {});
7578
unresolved?.set(serialize_promise, key);

0 commit comments

Comments
 (0)