98

I see the following errors when trying to start my app...

> [email protected] start /Users/johnnynolan/Repos/css-modules

webpack && open index.html

(node:5706) DeprecationWarning: Tapable.plugin is deprecated. Use new API on `.hooks` instead
/Users/johnnynolan/Repos/css-modules/node_modules/webpack/lib/Chunk.js:802
        throw new Error(
        ^

Error: Chunk.entrypoints: Use Chunks.groupsIterable and filter by instanceof Entrypoint instead
    at Chunk.get (/Users/johnnynolan/Repos/css-modules/node_modules/webpack/lib/Chunk.js:802:9)
    at /Users/johnnynolan/Repos/css-modules/node_modules/extract-text-webpack-plugin/dist/index.js:176:48
    at Array.forEach (<anonymous>)
    at /Users/johnnynolan/Repos/css-modules/node_modules/extract-text-webpack-plugin/dist/index.js:171:18
    at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/johnnynolan/Repos/css-modules/node_modules/tapable/lib/HookCodeFactory.js:24:12), <anonymous>:7:1)
    at AsyncSeriesHook.lazyCompileHook [as _callAsync] (/Users/johnnynolan/Repos/css-modules/node_modules/tapable/lib/Hook.js:35:21)
    at Compilation.seal (/Users/johnnynolan/Repos/css-modules/node_modules/webpack/lib/Compilation.js:1203:27)
    at hooks.make.callAsync.err (/Users/johnnynolan/Repos/css-modules/node_modules/webpack/lib/Compiler.js:547:17)
    at _err0 (eval at create (/Users/johnnynolan/Repos/css-modules/node_modules/tapable/lib/HookCodeFactory.js:24:12), <anonymous>:11:1)
    at _addModuleChain (/Users/johnnynolan/Repos/css-modules/node_modules/webpack/lib/Compilation.js:1054:12)
    at processModuleDependencies.err (/Users/johnnynolan/Repos/css-modules/node_modules/webpack/lib/Compilation.js:980:9)
    at _combinedTickCallback (internal/process/next_tick.js:131:7)
    at process._tickCallback (internal/process/next_tick.js:180:9)
    npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! [email protected] start: `webpack && open index.html`
    npm ERR! Exit status 1
    npm ERR! 
    npm ERR! Failed at the [email protected] start script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
    npm ERR! A complete log of this run can be found in:
    npm ERR!     /Users/johnnynolan/.npm/_logs/2018-07-17T14_04_42_021Z-debug.log
3
  • css-modules might be throwing something. Post the whole stack trace and your webpack config
    – PlayMa256
    Jul 17, 2018 at 14:15
  • I suggest you edit your question to something more along the lines of "How can I resolve this?" instead of "Has anyone seen this before?"
    – user47589
    Jul 17, 2018 at 14:15
  • 4
    extract-text-plugin does not work with Webpack v4
    – IVO GELOV
    Jul 17, 2018 at 14:21

4 Answers 4

198
npm install extract-text-webpack-plugin@next

This did the trick for me!

1
  • 1
    The @next brought me the "^4.0.0-beta.0", precisely what I needed. Thank you. Apr 23, 2020 at 2:16
86

Most of the comments here https://github.com/webpack-contrib/extract-text-webpack-plugin/issues/701 point to extract-text-plugin change it to mini-css-extract-plugin instead.

From the Github repo of extract-text-webpack-plugin https://github.com/webpack-contrib/extract-text-webpack-plugin

⚠️ Since webpack v4 the extract-text-webpack-plugin should not be used for css. Use mini-css-extract-plugin instead.

Head over to mini-css-extract-plugin on how to swap/upgrade it https://github.com/webpack-contrib/mini-css-extract-plugin

0
26

Yea, I got the same issue with webpack 4.10.2. The problem is fixed after I swap the extract-css-chunks-webpack-plugin to mini-css-extract-plugin.

Here's the webpack config changes:

-const ExtractCssChunks = require('extract-css-chunks-webpack-plugin')
+const MiniCssExtractPlugin = require("mini-css-extract-plugin");

module.exports = {
  name: 'client',
  target: 'web',
  module: {
    rules: [
      {
        test: /\.css$/,
-       use: ExtractCssChunks.extract({
-         use: 'css-loader'
-       })
+       use: [
+         {
+           loader: MiniCssExtractPlugin.loader,
+         },
+         "css-loader"
+       ]
      }
    ]
  },
// 
// other config........
//
   plugins: [
-    new ExtractCssChunks(),
+    new MiniCssExtractPlugin({
+        filename: `components/[name].css`
+    }),
     //
     // other config........
     //
   ]

Hope it can help.

1
  • It helped more than the above answers indeed. Thank you. Sep 16, 2020 at 7:23
7

I had fixed the bug by using the version 4.0.0-beta.0 of extract-text-webpack-plugin.

3
  • 4
    Updating to 4.0.0-beta.0 also fixed my issue
    – JillAndMe
    Dec 7, 2018 at 13:55
  • VS Code didnt have an auto complete for 4.x so thanks for saving me another google search with an explicit version.
    – steven87vt
    Feb 18, 2019 at 22:40
  • what path is that?
    – Grald
    Sep 7, 2019 at 16:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.