webpack: Error: Chunk.entry was removed. Use hasRuntime()

Just upgraded from 2.1.0-beta.15 to 2.1.0-beta.17. When I run my build using

webpack -p --env prod

I am getting the following error

Error: Chunk.entry was removed. Use hasRuntime()

Any ideas what is going on?

I have a demo this afternoon and need to get this working. Can’t go back to beta.15 because I was starting to see a different error there. Thanks in advance for your help.

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 74
  • Comments: 26 (6 by maintainers)

Commits related to this issue

Most upvoted comments

install extract-text-webpack-plugin@^2.0.0-beta

@galensheen What helped me was installing extract-text-webpack-plugin@^2.0.0-beta as @sokra has suggested earlier:

yarn add extract-text-webpack-plugin@^2.0.0-beta

Here is my current very simple webpack config, which seems to work:

var ExtractTextPlugin = require("extract-text-webpack-plugin");

module.exports = {
  entry: {
    a: './assets/a.js',
    b './assets/b.js'
  },
  module: {
    loaders: [{
      test: /\.js$/,
      loader: 'babel-loader',
      exclude: /node_modules/
    }, {
      test: /\.css$/,
      loader: ExtractTextPlugin.extract({
        fallbackLoader: 'style-loader',
        loader: 'css-loader'
      }),
    }, {
      test: /\.less$/,
      loader: ExtractTextPlugin.extract({
        fallbackLoader: 'style-loader',
        loader: 'css-loader!less-loader'
      }),
    }]
  },
  output: {
    path: "./build",
    filename: "[name].js"
  },
  plugins: [
    new ExtractTextPlugin({
      filename: "[name].css",
      allChunks: true
    })
  ]
};

@developer94404 as others in this thread have pointed out, you need to install a webpack2.0-compatible version of the plugin.

npm install extract-text-webpack-plugin@^2.0.0-beta --save-dev

In case somebody will try to find solution - extract-text-webpack-plugin@^2.0.0-beta did not work for me, but executing npm install --save-dev extract-text-webpack-plugin@^2.0.0-rc.3 works

Updating the Extract Text Plugin to 2.0.0-beta worked for the most part, however another problem has appeared, extracting CSS build with SASS plugin stopped working: https://github.com/webpack/extract-text-webpack-plugin/issues/211 It works correctly when not using ExtractTextPlugin, so it must be either a Webpack or Extract Text Plugin problem.

That’s something else. As workaround remove the DedupePlugin

@JonatanSalas: Would that be possible to share the versions of webpack and extract-text-plugin that work to build your MERN 2 project? Thanks a lot!

rc3 worked for me as well, however, running npm i extract-text-webpack-plugin@^2.0.0-beta added rc3 to my package.json file

@niieani, just got SASS working with this combo. I’m not chunking yet and hot updates not working but .scss are packed in .css in my distribution directory. Also using a global .scss with component level .scss. All combined into the [name].[id].style.css.

webpack.config.js:

module: {
      loaders: [
       {
          test: /\.scss$/,
          loader: ExtractTextPlugin.extract({
            fallbackLoader: 'style-loader',
            loader: ['css', 'sass']
          })
        },
...
plugins: [
      new ExtractTextPlugin({
        filename: '[name].[id].style.css',
        allChunks: true
      })
...

package.json:

...
    "css-loader": "^0.23.1",
    "extract-text-webpack-plugin": "^2.0.0-beta",
    "node-sass": "^3.8.0",
    "sass-loader": "^4.0.0",
    "style-loader": "^0.13.1",
    "webpack": "^2.1.0-beta.20",
...

Yep, just saw that (https://github.com/webpack/webpack/issues/2644). Problem solved. Thank you all for helping out. Keep up the great work!