-
-
Notifications
You must be signed in to change notification settings - Fork 866
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
Unexpected token: punc (.) #1921
Comments
Does your issue solve with React 18.2.0 ? @ksolanki9 |
I'm also running into a similar issue. Optional chaining works fine in my code but razzle isn't compiling node modules correctly. Any time I install a node module with optional chaining the terser build breaks with |
Update on this, setting |
below config fixed my issue, try once |
Thank you, this works! It works because we removed the plugins from the webpack optimization minimizer though. Did you have any issues with bundle size or unminimized css? |
So an update on this, this caused an error in production: Unexpected token '<'. |
🐛 Bug report
Current Behavior
Terser is creating issue while minification when minimizing one third part module on local machine.
Unexpected token: punc (.) [webpack://javascript/esm|./node_modules/somethirdpartypackage/dist/components/folder1/file1.js:24,0]
at ne (c:\temp\node_modules\terser-webpack-plugin\node_modules\terser\dist\bundle.min.js:1:195)
at c (c:\temp\node_modules\terser-webpack-plugin\node_modules\terser\dist\bundle.min.js:1:282)
at l (c:\temp\node_modules\terser-webpack-plugin\node_modules\terser\dist\bundle.min.js:1:283)
at f (c:\temp\node_modules\terser-webpack-plugin\node_modules\terser\dist\bundle.min.js:1:284)
at U (c:\temp\node_modules\terser-webpack-plugin\node_modules\terser\dist\bundle.min.js:1:422)
at me (c:\temp\node_modules\terser-webpack-plugin\node_modules\terser\dist\bundle.min.js:1:483)
at c:\temp\node_modules\terser-webpack-plugin\node_modules\terser\dist\bundle.min.js:1:492
at ve (c:\temp\node_modules\terser-webpack-plugin\node_modules\terser\dist\bundle.min.js:1:492)
at ke (c:\temp\node_modules\terser-webpack-plugin\node_modules\terser\dist\bundle.min.js:1:504)
at We (c:\temp\node_modules\terser-webpack-plugin\node_modules\terser\dist\bundle.min.js:1:507)
If we put minimization off as mentioned here #1012 then it works but then for whole project js compression and minimization not happening. do you know any workaround or exclude some particular node_modules from minification then would be good.
Your environment
The text was updated successfully, but these errors were encountered: