You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
svelte/documentation/docs/98-reference/.generated/server-errors.md

1.9 KiB

await_invalid

Encountered asynchronous work while rendering synchronously.

You (or the framework you're using) called render(...) with a component containing an await expression. Either await the result of render or wrap the await (or the component containing it) in a <svelte:boundary> with a pending snippet.

fn_unavailable_on_server

`%name%`(...) is unavailable on the server.

html_deprecated

The `html` property of server render results has been deprecated. Use `body` instead.

hydratable_clobbering

Attempted to set hydratable with key `%key%` twice. This behavior is undefined.

First set occurred at:
%stack%

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.

<script>
  import { hydratable } from 'svelte';

  await Promise.all([
    // which one should "win" and be serialized in the rendered response?
    hydratable('hello', () => 'world'),
    hydratable('hello', () => 'dad')
  ])
</script>

lifecycle_function_unavailable

`%name%(...)` is not available on the server
Certain methods such as `mount` cannot be invoked while running in a server context. Avoid calling them eagerly, i.e. not during render.

render_context_unavailable

Failed to retrieve `render` context. %addendum%

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 awaits.