You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Svelte-kit optimistically sets tsconfig.json -> compilerOptions.target = "esnext" which now become ES2022, but svelte/compiler is still using ecmaVersion: 12 aka ES2021, thus any ES2022 language feature will trigger Unexpected Token acorn error.
So it's either:
svelte-kit set tsconfig.json -> compilerOptions.target = "ES2021"
I haven't spent time reviewing internal of svelte/compiler module, it's unclear if updating AST to ES2022 will break things. Guess change made on svelte-kit's part is easier path for now, but in the long run ES upgrade need some attention.
Reproduction
Any component that uses latest ES2022 language feature will trigger the bug.
<script>letname='world';classGreeter{greeting;// class field declaration}</script><h1>Hello {name}!</h1>
Logs
No response
System Info
irrelevant
Severity
blocking an upgrade
The text was updated successfully, but these errors were encountered:
Describe the bug
Discovered when resolving a stackoverflow question.
Svelte-kit optimistically sets
tsconfig.json -> compilerOptions.target = "esnext"
which now becomeES2022
, butsvelte/compiler
is still usingecmaVersion: 12
akaES2021
, thus any ES2022 language feature will triggerUnexpected Token
acorn error.So it's either:
tsconfig.json -> compilerOptions.target = "ES2021"
svelte/src/compiler/parse/acorn.ts
I haven't spent time reviewing internal of
svelte/compiler
module, it's unclear if updating AST to ES2022 will break things. Guess change made on svelte-kit's part is easier path for now, but in the long run ES upgrade need some attention.Reproduction
Any component that uses latest ES2022 language feature will trigger the bug.
Logs
No response
System Info
Severity
blocking an upgrade
The text was updated successfully, but these errors were encountered: