Laravel-mix: Unexpected token: name (Dom7)

Created on 4 Oct 2017  路  9Comments  路  Source: JeffreyWay/laravel-mix

  • Laravel Mix Version: 1.4.5
  • Node Version: v8.6.0
  • NPM Version: 5.4.2
  • OS: macOS Sierra

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?

Most helpful comment

For me it was nolimits4web/Swiper that was causing this problem - I've downgraded to v3.4.2 and the problem went away.

All 9 comments

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/Swiper that was causing this problem - I've downgraded to v3.4.2 and 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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

wendt88 picture wendt88  路  3Comments

mementoneli picture mementoneli  路  3Comments

dtheb picture dtheb  路  3Comments

rlewkowicz picture rlewkowicz  路  3Comments

sdebacker picture sdebacker  路  3Comments