Skip to content

Commit a2aa14c

Browse files
authored
docs: fix bad export from remote module (#15650)
you can't export anything from a `.remote.ts` file other than remote functions — the example in the docs is broken
1 parent ddb9570 commit a2aa14c

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

documentation/docs/20-core-concepts/60-remote-functions.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -392,13 +392,22 @@ Because our form contains a `file` input, we've added an `enctype="multipart/for
392392
393393
In the case of `radio` and `checkbox` inputs that all belong to the same field, the `value` must be specified as a second argument to `.as(...)`:
394394
395+
```js
396+
/// file: constants.js
397+
export const operatingSystems = /** @type {const} */ (['windows', 'mac', 'linux']);
398+
export const languages = /** @type {const} */ (['html', 'css', 'js']);
399+
```
400+
395401
```js
396402
/// file: data.remote.js
403+
// @filename: constants.js
404+
export const operatingSystems = /** @type {const} */ (['windows', 'mac', 'linux']);
405+
export const languages = /** @type {const} */ (['html', 'css', 'js']);
406+
// @filename: index.js
397407
import * as v from 'valibot';
398408
import { form } from '$app/server';
399409
// ---cut---
400-
export const operatingSystems = /** @type {const} */ (['windows', 'mac', 'linux']);
401-
export const languages = /** @type {const} */ (['html', 'css', 'js']);
410+
import { operatingSystems, languages } from './constants';
402411

403412
export const survey = form(
404413
v.object({

0 commit comments

Comments
 (0)