remove await_outside_boundary error (#16762)

pull/16769/head
Rich Harris 3 days ago committed by GitHub
parent ed3cb33b6c
commit fbef4bbd7c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -1,21 +1,5 @@
<!-- This file is generated by scripts/process-messages/index.js. Do not edit! --> <!-- 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 ### invalid_default_snippet
``` ```

@ -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 ## invalid_default_snippet
> Cannot use `{@render children(...)}` if the parent component uses `let:` directives. Consider using a named snippet instead > Cannot use `{@render children(...)}` if the parent component uses `let:` directives. Consider using a named snippet instead

@ -437,13 +437,7 @@ function move_effect(effect, fragment) {
} }
export function get_boundary() { export function get_boundary() {
var boundary = /** @type {Effect} */ (active_effect).b; return /** @type {Boundary} */ (/** @type {Effect} */ (active_effect).b);
if (boundary === null) {
e.await_outside_boundary();
}
return boundary;
} }
export function pending() { export function pending() {

@ -605,8 +605,6 @@ export {
export { escape_html as escape }; export { escape_html as escape };
export { await_outside_boundary } from '../shared/errors.js';
/** /**
* @template T * @template T
* @param {()=>T} fn * @param {()=>T} fn

@ -2,22 +2,6 @@
import { DEV } from 'esm-env'; 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 * Cannot use `{@render children(...)}` if the parent component uses `let:` directives. Consider using a named snippet instead
* @returns {never} * @returns {never}

Loading…
Cancel
Save