D
D
Denis2017-09-10 21:10:56
webpack
Denis, 2017-09-10 21:10:56

Can't get over error when using extract-text-webpack-plugin?

Good evening! When working with webpack, I decided to use the extract-text-webpack-plugin. But ran into an error. At first the request was for some 'emojis-list' module. After doing npm i emojis-list another error appeared:
C:\WebServers\home\learn-webpack\www\node_modules\webpack\lib\Chunk.js:59
throw new Error("Chunk.entry was removed. Use hasRuntime()");
^
Error: Chunk.entry was removed. Use hasRuntime()
at Chunk.entry (C:\WebServers\home\learn-webpack\www\node_modules\webpack\lib\Chunk.js:59:9)
at C:\WebServers\home\learn-webpack\www\ node_modules\extract-text-webpack-plugin\index.js:201:13
at Array.filter (native)
at Compilation. (C:\WebServers\home\learn-webpack\www\node_modules\extract-text-webpack-plugin\index.js:200:37)
at Compilation.applyPlugins0 (C:\WebServers\home\learn-webpack\www\ node_modules\tapable\lib\Tapable.js:68:14)
at Compilation.seal (C:\WebServers\home\learn-webpack\www\node_modules\webpack\lib\Compilation.js:558:8)
at C:\ WebServers\home\learn-webpack\www\node_modules\webpack\lib\Compiler.js:474:16
at C:\WebServers\home\learn-webpack\www\node_modules\tapable\lib\Tapable.js:225:11
at C:\WebServers\home\learn-webpack\www\node_modules\webpack\lib\Compilation.js:472:11
at C:\WebServers\home\learn-webpack\www\node_modules\webpack\lib\Compilation.js :443:13
at nextTickCallbackWith0Args (node.js:433:9)
at process._tickCallback (node.js:362:13)
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "build"
npm ERR! node v5.2.0
npm ERR! npm v3.3.12
npm ERR! code ELIFECYCLE
npm ERR! [email protected] build: `webpack`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build script 'webpack'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the webpack_learn package,
npm ERR! not with npm itself.
npm ERR!
npm ERR! webpack
npm ERR! You can get their info via:
npm ERR! npm owner ls webpack_learn
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! C:\WebServers\home\learn-webpack\www\npm-debug.log
Here is the config. webpack file:

var webpack = require('webpack');
var NODE_ENV = process.env.NODE_ENV || 'development';
var ExtractTextPlugin = require('extract-text-webpack-plugin');

module.exports = {
    context: __dirname + '/js/src',
    entry: {
        main: './main.js',
        about: './about.js'
    },
    output: {
        path: __dirname + '/js/dist',
        publicPath: '/js/dist/',
        filename: "[name].js",
        chunkFilename: '[id].[name].js',
        library: '[name]'
    },
    watch: NODE_ENV == 'development',
    watchOptions: {
        aggregateTimeout: 100
    },
    devtool: NODE_ENV == 'development' ? 'cheap-inline-module-source-map' : false,
    resolve: {
        modules: ['node_modules'],
        extensions: ['.js', '.json']
    },
    resolveLoader: {
        modules: ['node_modules'],
        moduleExtensions: ['-loader'],
        extensions: ['.js', '.json']
    },
    module: {
        loaders: [
            {
                test: /\.js$/,
                loader: 'babel'
            },
            {
                test:/\.less$/,
                loader: ExtractTextPlugin.extract('css!less?resolve url')
            }
        ]
    },
    plugins: [
        new ExtractTextPlugin('app.css', { allChunks: true }),
        new webpack.NoEmitOnErrorsPlugin(),
        new webpack.optimize.CommonsChunkPlugin({
            name: 'common',
            chunks: ['main', 'about']
        }),
        new webpack.DefinePlugin({
            NODE_ENV: JSON.stringify(NODE_ENV),
            LANG: JSON.stringify('ru')
        })
    ]
};

if(NODE_ENV == 'production') {
    module.exports.plugins.push(
        new webpack.optimize.UglifyJsPlugin({
            compress: {
                warnings: false,
                drop_console: true,
                unsafe: true
            }
        })
    );
}

Tell me what could be the problem, please.
How can you decide

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim, 2017-09-10
@maxfarseer

Hi Denis. Update extract-text-webpack-plugin, this is most likely the problem.
I have"extract-text-webpack-plugin": "^2.0.0-rc.2",

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question