Skip to content

Commit d5e4af8

Browse files
fixes
1 parent 998510c commit d5e4af8

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ You (or the framework you're using) called [`render(...)`](svelte-server#render)
1919
> First set occurred at:
2020
> %stack%
2121
22-
This error occurs when using `hydratable` or `setHydratableValue` multiple times with the same key. To avoid this, you can combine `hydratable` with `cache`, or check whether the value has already been set with `hasHydratableValue`.
22+
This error occurs when using `hydratable` or `hydratable.set` multiple times with the same key. To avoid this, you can combine `hydratable` with `cache`, or check whether the value has already been set with `hydratable.has`.
2323

2424
```svelte
2525
<script>

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ function isomorphic_hydratable(key, fn, options) {
2121
(val, has) => {
2222
if (!has) {
2323
w.hydratable_missing_but_expected(key);
24+
return fn();
2425
}
2526
return decode(val, options?.decode);
2627
},
@@ -45,7 +46,7 @@ export { hydratable };
4546
*/
4647
function get_hydratable_value(key, options = {}) {
4748
if (!async_mode_flag) {
48-
e.experimental_async_required('getHydratableValue');
49+
e.experimental_async_required('hydratable.get');
4950
}
5051

5152
return access_hydratable_store(
@@ -61,7 +62,7 @@ function get_hydratable_value(key, options = {}) {
6162
*/
6263
function has_hydratable_value(key) {
6364
if (!async_mode_flag) {
64-
e.experimental_async_required('hasHydratableValue');
65+
e.experimental_async_required('hydratable.set');
6566
}
6667
return access_hydratable_store(
6768
key,

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export { hydratable };
4646
*/
4747
function set_hydratable_value(key, value, options = {}) {
4848
if (!async_mode_flag) {
49-
e.experimental_async_required('setHydratableValue');
49+
e.experimental_async_required('hydratable.set');
5050
}
5151

5252
const store = get_render_context();
@@ -64,7 +64,7 @@ function set_hydratable_value(key, value, options = {}) {
6464
*/
6565
function has_hydratable_value(key) {
6666
if (!async_mode_flag) {
67-
e.experimental_async_required('hasHydratableValue');
67+
e.experimental_async_required('hydratable.has');
6868
}
6969
const store = get_render_context();
7070
return store.hydratables.has(key);

0 commit comments

Comments
 (0)