Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion documentation/docs/20-core-concepts/60-remote-functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ Remote functions are exported from a `.remote.js` or `.remote.ts` file, and come

The `query` function allows you to read dynamic data from the server (for _static_ data, consider using [`prerender`](#prerender) instead):

> [!NOTE] `query` functions need a server at runtime. They cannot be used while prerendering (for example when `export const prerender = true` is set on the page or a parent `+layout`). If you need data during prerendering, use [`prerender`](#prerender) instead.

```js
/// file: src/routes/blog/data.remote.js
// @filename: ambient.d.ts
Expand Down Expand Up @@ -1041,7 +1043,7 @@ You can use `prerender` functions on pages that are otherwise dynamic, allowing

In the browser, prerendered data is saved using the [`Cache`](https://developer.mozilla.org/en-US/docs/Web/API/Cache) API. This cache survives page reloads, and will be cleared when the user first visits a new deployment of your app.

> [!NOTE] When the entire page has `export const prerender = true`, you cannot use queries, as they are dynamic.
> [!NOTE] `prerender` functions run at build time, so they work on prerendered pages and in fully static builds (for example with [`adapter-static`](adapter-static)). The restriction applies to [`query`](#query): it requires a server at runtime and will fail if called during prerendering.

### Prerender arguments

Expand Down