Skip to content

CommonsChunkPlugin error: Invalid chunkNames argument #1656

@bertez

Description

@bertez

After updating to the latest version of webpack (1.12.8) I'm getting this error:

/Users/berto/Projects/www/my_project/node_modules/webpack/lib/optimize/CommonsChunkPlugin.js:65
                throw new Error("Invalid chunkNames argument");
                ^

Error: Invalid chunkNames argument
    at Compilation.<anonymous> (/Users/berto/Projects/www/my_project/node_modules/webpack/lib/optimize/CommonsChunkPlugin.js:65:11)
    at Compilation.applyPlugins (/Users/berto/Projects/www/my_project/node_modules/tapable/lib/Tapable.js:26:37)
    at Compilation.seal (/Users/berto/Projects/www/my_project/node_modules/webpack/lib/Compilation.js:522:7)
    at Compiler.<anonymous> (/Users/berto/Projects/www/my_project/node_modules/webpack/lib/Compiler.js:397:15)
    at /Users/berto/Projects/www/my_project/node_modules/tapable/lib/Tapable.js:103:11
    at Compilation.<anonymous> (/Users/berto/Projects/www/my_project/node_modules/webpack/lib/Compilation.js:445:10)
    at /Users/berto/Projects/www/my_project/node_modules/webpack/lib/Compilation.js:417:12
    at /Users/berto/Projects/www/my_project/node_modules/webpack/lib/Compilation.js:332:10
    at /Users/berto/Projects/www/my_project/node_modules/async/lib/async.js:52:16
    at done (/Users/berto/Projects/www/my_project/node_modules/async/lib/async.js:246:17)

I'm instantiating the plugin this way:

const commonsPlugin = new webpack.optimize.CommonsChunkPlugin({
    filename: 'common.[hash].js',
    minChunks: 2
});

This code was working with version 1.12.4.

Any help would be appreciated. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions