Cannot run gulp - TypeError: webpack.optimize.CommonsChunkPlugin is not a constructor
Type of issue
Issue with running gulp
Description
I recently updated my fork master to upstream master.
Whenever i try to run gulp serve or gulp build i get the following error.
before this error, zsh could not find gulp.
I had to reinstall it globally and now this is happening.
Could anyone please assist me.
Thanks in advance!
TypeError: webpack.optimize.CommonsChunkPlugin is not a constructor
at Object.<anonymous> (/Users/abrowning14/Documents/CODE/Projects/Prebid/Prebid.js/webpack.conf.js:27:3)
at Module._compile (node:internal/modules/cjs/loader:1092:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1121:10)
at Module.load (node:internal/modules/cjs/loader:972:32)
at Function.Module._load (node:internal/modules/cjs/loader:813:14)
at Module.require (node:internal/modules/cjs/loader:996:19)
at require (node:internal/modules/cjs/helpers:92:18)
at Object.<anonymous> (/Users/abrowning14/Documents/CODE/Projects/Prebid/Prebid.js/karma.conf.maker.js:6:19)
at Module._compile (node:internal/modules/cjs/loader:1092:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1121:10)
Steps to reproduce
$git fetch upstream$ git checkout master$ git merge upstream master$ npm ci$ gulp serve
Test page
Expected results
Actual results
Cannot run prebid.js to check adapter developments.
Platform details
Mac OS 10.15.7 zsh 5.7.1 node v15.14.0 npm 7.7.6 gulp cli 2.3.0 gulp local 4.0.2
Other information
looks like webpack.optimize.CommonsChunkPlugin doesn't exist after I checked by doing console.log(webpack.optimize).
According to this https://webpack.js.org/plugins/commons-chunk-plugin/ the method has been depreciated in webpack v4 legato.
Checked upstream package-lock webpack version - currently on 3.12.0
Seems to be a local issue with my fork. probably an audit fix I did incorrectly with breaking change.
Will check on my end first.
rebased master using upstream/master and clean npm ci pacakge-lock webpack is back to version 3.12.0 gulp working as expected