-
Notifications
You must be signed in to change notification settings - Fork 71
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
Optional chaining doesn't work #137
Comments
We'd need a repro for this. My guess is that you're either accidentally using an older version of Svelte or this is an error from a different plugin/loader that doesn't support this syntax. |
Webpack 4 doesn’t support optional chaining as it uses an old version of acorn, see webpack/webpack#10227 (comment) |
If you're using Svelte + Webpack 4 and want to use nullish coaslescing operator or optional chaining, you can use "resolutions": {
"acorn": "8.0.1"
}, Then, run I've tested using null coalescing operator, no more errors, but I've not tested optional chaining yet. See this issue for further information, there's also npm way, |
Optional chaining doesn't work with webpack and it most likely related to svelte-loader, as it works with rollup. Svelte itself already supports optional chaining since acorn has shipped it (see repl). But in webpack I am getting the next error:
Will the issue be fixed?
The text was updated successfully, but these errors were encountered: