fix: allow await
in {@const }
in more blocks
await doesn't work when used in conjunction with @const
await isn't allowed in non-async function (Note that you need plugins to import files that are not JavaScript)
Using Svelte compiler version 5.36.12
running Svelte compiler version 5.36.12
blocking an upgrade
Closes #16462
feat:
, fix:
, chore:
, or docs:
.packages/svelte/src
, add a changeset (npx changeset
).pnpm test
and lint the project with pnpm lint
Latest commit: 5c784e2
The changes in this PR will be included in the next version bump.
Name | Type |
---|---|
svelte | Patch |
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
pnpm add https://pkg.pr.new/svelte@16568
I'm not sure if this is a bug or if I'm misunderstanding something, but I've encountered an issue.
The {@const { data } = await fetch}
syntax works correctly on initial page load. However, when I navigate to a different page, I get the following error: Uncaught (in promise) TypeError: Cannot destructure property 'data' of '$.get(...)' as it is undefined
.
It appears that the data
variable becomes undefined during the navigation to the next page, which leads to the destructuring failing and causing the error.
I'm not sure if this is a bug or if I'm misunderstanding something, but I've encountered an issue.
The
{@const { data } = await fetch}
syntax works correctly on initial page load. However, when I navigate to a different page, I get the following error:Uncaught (in promise) TypeError: Cannot destructure property 'data' of '$.get(...)' as it is undefined
.It appears that the
data
variable becomes undefined during the navigation to the next page, which leads to the destructuring failing and causing the error.
The issue you're encountering may be related to this bug in async svelte: #16387
Closing in favor of #16643