Skip to content

Commit 99fdc3f

Browse files
docs: update error message for const_tag_invalid_placement (#15003)
1 parent a129592 commit 99fdc3f

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

documentation/docs/98-reference/.generated/compile-errors.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ Cyclical dependency detected: %cycle%
187187
### const_tag_invalid_placement
188188

189189
```
190-
`{@const}` must be the immediate child of `{#snippet}`, `{#if}`, `{:else if}`, `{:else}`, `{#each}`, `{:then}`, `{:catch}`, `<svelte:fragment>` or `<Component>`
190+
`{@const}` must be the immediate child of `{#snippet}`, `{#if}`, `{:else if}`, `{:else}`, `{#each}`, `{:then}`, `{:catch}`, `<svelte:fragment>`, `<svelte:boundary` or `<Component>`
191191
```
192192

193193
### constant_assignment

packages/svelte/messages/compile-errors/template.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@
118118
119119
## const_tag_invalid_placement
120120

121-
> `{@const}` must be the immediate child of `{#snippet}`, `{#if}`, `{:else if}`, `{:else}`, `{#each}`, `{:then}`, `{:catch}`, `<svelte:fragment>` or `<Component>`
121+
> `{@const}` must be the immediate child of `{#snippet}`, `{#if}`, `{:else if}`, `{:else}`, `{#each}`, `{:then}`, `{:catch}`, `<svelte:fragment>`, `<svelte:boundary` or `<Component>`
122122
123123
## debug_tag_invalid_arguments
124124

packages/svelte/src/compiler/errors.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -888,12 +888,12 @@ export function const_tag_invalid_expression(node) {
888888
}
889889

890890
/**
891-
* `{@const}` must be the immediate child of `{#snippet}`, `{#if}`, `{:else if}`, `{:else}`, `{#each}`, `{:then}`, `{:catch}`, `<svelte:fragment>` or `<Component>`
891+
* `{@const}` must be the immediate child of `{#snippet}`, `{#if}`, `{:else if}`, `{:else}`, `{#each}`, `{:then}`, `{:catch}`, `<svelte:fragment>`, `<svelte:boundary` or `<Component>`
892892
* @param {null | number | NodeLike} node
893893
* @returns {never}
894894
*/
895895
export function const_tag_invalid_placement(node) {
896-
e(node, 'const_tag_invalid_placement', `\`{@const}\` must be the immediate child of \`{#snippet}\`, \`{#if}\`, \`{:else if}\`, \`{:else}\`, \`{#each}\`, \`{:then}\`, \`{:catch}\`, \`<svelte:fragment>\` or \`<Component>\`\nhttps://svelte.dev/e/const_tag_invalid_placement`);
896+
e(node, 'const_tag_invalid_placement', `\`{@const}\` must be the immediate child of \`{#snippet}\`, \`{#if}\`, \`{:else if}\`, \`{:else}\`, \`{#each}\`, \`{:then}\`, \`{:catch}\`, \`<svelte:fragment>\`, \`<svelte:boundary\` or \`<Component>\`\nhttps://svelte.dev/e/const_tag_invalid_placement`);
897897
}
898898

899899
/**

packages/svelte/tests/validator/samples/const-tag-placement-1/errors.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[
22
{
33
"code": "const_tag_invalid_placement",
4-
"message": "`{@const}` must be the immediate child of `{#snippet}`, `{#if}`, `{:else if}`, `{:else}`, `{#each}`, `{:then}`, `{:catch}`, `<svelte:fragment>` or `<Component>`",
4+
"message": "`{@const}` must be the immediate child of `{#snippet}`, `{#if}`, `{:else if}`, `{:else}`, `{#each}`, `{:then}`, `{:catch}`, `<svelte:fragment>`, `<svelte:boundary` or `<Component>`",
55
"start": {
66
"line": 5,
77
"column": 0

packages/svelte/tests/validator/samples/const-tag-placement-2/errors.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[
22
{
33
"code": "const_tag_invalid_placement",
4-
"message": "`{@const}` must be the immediate child of `{#snippet}`, `{#if}`, `{:else if}`, `{:else}`, `{#each}`, `{:then}`, `{:catch}`, `<svelte:fragment>` or `<Component>`",
4+
"message": "`{@const}` must be the immediate child of `{#snippet}`, `{#if}`, `{:else if}`, `{:else}`, `{#each}`, `{:then}`, `{:catch}`, `<svelte:fragment>`, `<svelte:boundary` or `<Component>`",
55
"start": {
66
"line": 7,
77
"column": 4

0 commit comments

Comments
 (0)