-
-
Notifications
You must be signed in to change notification settings - Fork 64
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
?.
Module parse failed: Unexpected token
#30
Comments
It's not a TypeScript specific feature. Webpack 5 supports the syntax. |
Mhh, okay interesting and good to know. But for more context: This error appeared in the currect storybook version 6.3.12 which theoretically uses webpack 5. |
What do you mean "theoretically"? Storybook supports both webpack 4 and 5, and the default version is still 4. |
Ohh ok sorry, I thought they switched to v5 in general. I'm sorry for the misunderstanding. At least we found the source of the problem. |
😎👍 |
I use the plugin with nextjs v11 which uses webpack 5, but i have the same error |
If so, it's fatal for all nextjs users. You should report the bug to nextjs. |
i've also installed
and this didn't help |
It's one of the solution for webpack4 to recognize the optional chaining. Webpack 5 does not require it since it uses the latest acorn under the hood. |
Excuse me how to use {
"plugins": [
"@babel/plugin-proposal-optional-chaining"
]
} this didn't help |
nextjs authors told me that "Next.js already supports optional chaining but node_modules are not compiled using Babel." |
Ah, nextjs does not support transpiling node modules. It sounds very inconvenient. Okay. I'll think about it. |
I transpiled the chaining syntax(^0.6.7). |
thanks, mate! |
👍 |
Could someone help me to get the exact issue here.
|
Checks
Version
0.6.5
Description
I only know the
?.
syntax from TypeScript and I think that's the issue here.Reproduction Link
No response
Steps to Reproduce
Expected Behaviour
Should build without error
The text was updated successfully, but these errors were encountered: