Webpack.optimize.ModuleConcatenationPlugin is not a constructor

Getting the following error in Travis CI since upgrading to Webpack 3.

It seems like I am working fine in my local environment, but when I take responsibility for the master and Travis punch, he continues to fail with the following error.

21 06 2017 20:16:31.514:ERROR [config]: Invalid config file!
  TypeError: webpack.optimize.ModuleConcatenationPlugin is not a constructor
    at Object.<anonymous> (/home/travis/build/.../webpack.prod.config.babel.js:91:3)
    at Module._compile (module.js:569:30)
    at loader (/home/travis/build/.../node_modules/babel-register/lib/node.js:144:5)
    at Object.require.extensions.(anonymous function) [as .js] (/home/travis/build/.../node_modules/babel-register/lib/node.js:154:7)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)

And the line he's complaining about

  // Webpack 3 Scope Hoisting
  new webpack.optimize.ModuleConcatenationPlugin(),

And also install Webpack on version 3 in my package. json ofcourse.

"webpack": "^3.0.0",

And my Travis yml is pretty simple

language: node_js
sudo: false
node_js:
- '8'
+6
source share
1 answer

Uninstall node_modulesand package-lock.jsonthen run npm installagain to create a new one package-lock.json. After you commit a new one package-lock.json, Travis should work correctly.

, , , .

+6

All Articles