Prebid.js icon indicating copy to clipboard operation
Prebid.js copied to clipboard

Cannot run gulp - TypeError: webpack.optimize.CommonsChunkPlugin is not a constructor

Open adam-browning opened this issue 5 years ago • 2 comments

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

  1. $git fetch upstream
  2. $ git checkout master
  3. $ git merge upstream master
  4. $ npm ci
  5. $ 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

adam-browning avatar Apr 12 '21 14:04 adam-browning

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.

adam-browning avatar Apr 12 '21 14:04 adam-browning

rebased master using upstream/master and clean npm ci pacakge-lock webpack is back to version 3.12.0 gulp working as expected

adam-browning avatar Apr 12 '21 15:04 adam-browning