I just updated laravel-mix to the latest version and when I run npm run production I now get the following error:
js/dist/app.js from UglifyJs
Unexpected token: name (Dom7) [./node_modules/dom7/dist/dom7.modular.js:14,0][js/dist/app.js:24688,6]
It works fine with npm run watch - just when I try to compile for production.
Looks like dom7 package related?
I think this is actually related to the issue with one of the plugins (swiper).
Hello,
I have this problem how can I fix it?
For me it was nolimits4web/Swiper that was causing this problem - I've downgraded to v3.4.2 and the problem went away.
v4 and v3 have different API's though, meaning this force a code change and not just a library downgrade. It's a tree-shaking thing for me when compiling with AOT in Angular2.
@mrowles @sebastiansulinski I've pulled in the latest swiper version 4.0.5 from 4.0.3 and it's now working with yarn run production I guess there might have been a fix released recently?
This is happening for me with swiper version 4.0.6, npm run build causes
Unexpected token: name (Dom7) [./node_modules/dom7/dist/dom7.modular.js:14,0]
Please try the following configuration #1323 and see if it resolves the problem.
For me it was
nolimits4web/Swiperthat was causing this problem - I've downgraded tov3.4.2and the problem went away.
How did you figure this was related?
When you check the package codebase you鈥檒l see it is now using modules - hence needs es6 compiling.
Most helpful comment
For me it was
nolimits4web/Swiperthat was causing this problem - I've downgraded tov3.4.2and the problem went away.