-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Destructuring $state array causes build to error #16093
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
It seems to work as expected here. |
It looks like a rollup error. But I don’t see how the JavaScript output from the svelte component could trigger that error |
Something similar was fixed recently, which version of svelte are you on? |
|
Oh well... here's the generated server code lol import * as $ from 'svelte/internal/server';
export default function App($$payload) {
let tmp = [10, "Admin"],
level = #[0],
custom = #[1];
$$payload.out += `<!---->${$.escape(level)}, ${$.escape(custom)}`;
} |
Whoops, I only checked the client code when I was curious whether I could find it 😄 |
Found the issue, don't know how this wasn't noticed before |
Describe the bug
Array destructuring from $state causes the build to error. This was working in 5.33.4 but is broken in the latest 5.33.14
Reproduction
Include the line
let [level, custom] = $state([10, "Admin"])
in a Svelte file in your project and then attempt to build.Or:
Repo: https://github.com/WaltzingPenguin/sveltekit-expected-ident
Install project and execute
npm run build
Logs
System Info
Severity
blocking an upgrade
The text was updated successfully, but these errors were encountered: