![[Webpack4 アップデートエラー] Error: Chunk.entrypoints: Use Chunks.groupsIterable and filter by instanceof Entrypoint instead](/static/613d2a27ef1414b1f2fc21fd2791d126/2db52/webpackv4_error_01.png)
Webpack4系にすると、エラーが起きたので解決策を。
現状バージョン
"webpack": "^4.7.0",
"extract-text-webpack-plugin": "^3.0.2"
エラー内容
Error: Chunk.entrypoints: Use Chunks.groupsIterable and filter by instanceof Entrypoint instead
以下省略・・・
npm ERR! code ELIFECYCLE
npm ERR! errno 1
以下省略・・・
どうやらextract-text-webpack-pluginが原因っぽい。
extract-text-webpack-pluginはWebpackのバージョンが4以上だとまだうまく作動しないみたい。
解決策
npm install -D extract-text-webpack-plugin@next
これでnextのバージョンをインストールすると直る。
参考サイト: “react-scripts build” gives webpack error: “Chunk.entrypoints: Use Chunks.addGroup instead”