Skip to content
Merged
Show file tree
Hide file tree
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
16 changes: 0 additions & 16 deletions documentation/docs/98-reference/.generated/shared-errors.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,5 @@
<!-- This file is generated by scripts/process-messages/index.js. Do not edit! -->

### await_outside_boundary

```
Cannot await outside a `<svelte:boundary>`.
```

The `await` keyword can only appear in a `$derived(...)` or template expression, or at the top level of a component's `<script>` block, if it is inside a [`<svelte:boundary>`](/docs/svelte/svelte-boundary):

```svelte
<svelte:boundary>
<p>{await getData()}</p>
</svelte:boundary>
```

This restriction may be lifted in a future version of Svelte.

### invalid_default_snippet

```
Expand Down
14 changes: 0 additions & 14 deletions packages/svelte/messages/shared-errors/errors.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,3 @@
## await_outside_boundary

> Cannot await outside a `<svelte:boundary>`.

The `await` keyword can only appear in a `$derived(...)` or template expression, or at the top level of a component's `<script>` block, if it is inside a [`<svelte:boundary>`](/docs/svelte/svelte-boundary):

```svelte
<svelte:boundary>
<p>{await getData()}</p>
</svelte:boundary>
```

This restriction may be lifted in a future version of Svelte.

## invalid_default_snippet

> Cannot use `{@render children(...)}` if the parent component uses `let:` directives. Consider using a named snippet instead
Expand Down
8 changes: 1 addition & 7 deletions packages/svelte/src/internal/client/dom/blocks/boundary.js
Original file line number Diff line number Diff line change
Expand Up @@ -437,13 +437,7 @@ function move_effect(effect, fragment) {
}

export function get_boundary() {
var boundary = /** @type {Effect} */ (active_effect).b;

if (boundary === null) {
e.await_outside_boundary();
}

return boundary;
return /** @type {Boundary} */ (/** @type {Effect} */ (active_effect).b);
}

export function pending() {
Expand Down
2 changes: 0 additions & 2 deletions packages/svelte/src/internal/server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -605,8 +605,6 @@ export {

export { escape_html as escape };

export { await_outside_boundary } from '../shared/errors.js';

/**
* @template T
* @param {()=>T} fn
Expand Down
16 changes: 0 additions & 16 deletions packages/svelte/src/internal/shared/errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,6 @@

import { DEV } from 'esm-env';

/**
* Cannot await outside a `<svelte:boundary>`.
* @returns {never}
*/
export function await_outside_boundary() {
if (DEV) {
const error = new Error(`await_outside_boundary\nCannot await outside a \`<svelte:boundary>\`.\nhttps://svelte.dev/e/await_outside_boundary`);

error.name = 'Svelte error';

throw error;
} else {
throw new Error(`https://svelte.dev/e/await_outside_boundary`);
}
}

/**
* Cannot use `{@render children(...)}` if the parent component uses `let:` directives. Consider using a named snippet instead
* @returns {never}
Expand Down
Loading