vanilla-lazyload: Uncaught TypeError: Assignment to constant variable (Chrome)
Can`t build for production mode with 10.17 version (dev version is well), got error: Uncaught TypeError: Assignment to constant variable. Using Laravel mix with Webpack (Laravel mix using “webpack”: “^3.11.0”)
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 21 (10 by maintainers)
Your guess was correct. Here is the related UglifyJS issue: https://github.com/mishoo/UglifyJS2/issues/2842 (it’s an ongoing issue). There is a workaround, you just need to disable inlining in UglifyJS.
So, in webpack we need to provide the UglifyJS options to the plugin via
uglifyOptionslike this:new UglifyJsPlugin({ uglifyOptions: { compress: { inline: false } } }). This fixes the issue in our case.