@ -37,10 +37,10 @@ This error occurs when using `hydratable` or `setHydratableValue` multiple times
</script>
</script>
```
```
### lifecycle_function_unavailable
### render_context_unavailable
```
```
`%name%(...)` is not available on the server
Failed to retrieve `render` context. %addendum%
```
```
Certain methods such as `mount` cannot be invoked while running in a server context. Avoid calling them eagerly, i.e. not during render.
If `AsyncLocalStorage` is available, you're likely calling a function that needs access to the `render` context (`hydratable`, `cache`, or something that depends on these) from outside of `render`. If `AsyncLocalStorage` is not available, these functions must also be called synchronously from within `render` -- i.e. not after any `await`s.
@ -42,6 +42,14 @@ Here, `List.svelte` is using `{@render children(item)` which means it expects `P
A snippet function was passed invalid arguments. Snippets should only be instantiated via `{@render ...}`
A snippet function was passed invalid arguments. Snippets should only be instantiated via `{@render ...}`
```
```
### lifecycle_function_unavailable
```
`%name%(...)` is not available on the %location%
```
Certain methods such as `mount` cannot be invoked while running in a server context, while others, such as `hydratable.set`, cannot be invoked while running in the browser.
@ -29,8 +29,8 @@ This error occurs when using `hydratable` or `setHydratableValue` multiple times
</script>
</script>
```
```
## lifecycle_function_unavailable
## render_context_unavailable
> `%name%(...)` is not available on the server
> Failed to retrieve `render` context. %addendum%
Certain methods such as `mount` cannot be invoked while running in a server context. Avoid calling them eagerly, i.e. not during render.
If `AsyncLocalStorage` is available, you're likely calling a function that needs access to the `render` context (`hydratable`, `cache`, or something that depends on these) from outside of `render`. If `AsyncLocalStorage` is not available, these functions must also be called synchronously from within `render` -- i.e. not after any `await`s.
@ -34,6 +34,12 @@ Here, `List.svelte` is using `{@render children(item)` which means it expects `P
> A snippet function was passed invalid arguments. Snippets should only be instantiated via `{@render ...}`
> A snippet function was passed invalid arguments. Snippets should only be instantiated via `{@render ...}`
## lifecycle_function_unavailable
> `%name%(...)` is not available on the %location%
Certain methods such as `mount` cannot be invoked while running in a server context, while others, such as `hydratable.set`, cannot be invoked while running in the browser.
## lifecycle_outside_component
## lifecycle_outside_component
> `%name%(...)` can only be used during component initialisation
> `%name%(...)` can only be used during component initialisation
consterror=newError(`lifecycle_function_unavailable\n\`${name}(...)\` is not available on the server\nhttps://svelte.dev/e/lifecycle_function_unavailable`);
consterror=newError(`render_context_unavailable\nFailed to retrieve \`render\` context. ${addendum}\nhttps://svelte.dev/e/render_context_unavailable`);
consterror=newError(`lifecycle_function_unavailable\n\`${name}(...)\` is not available on the ${location}\nhttps://svelte.dev/e/lifecycle_function_unavailable`);