Copy-webpack-plugin: Error: CopyWebpackPlugin is not a function

Created on 13 May 2016  路  11Comments  路  Source: webpack-contrib/copy-webpack-plugin

I'm getting the following error when using Version 2.1.4:

module.exports = new CopyWebpackPlugin([{
^

TypeError: CopyWebpackPlugin is not a function
at Object. (build/copy.js:3:18)
at Module._compile (module.js:413:34)
at Object.Module._extensions..js (module.js:422:10)
at Module.load (module.js:357:32)
at Function.Module._load (module.js:314:12)
at Module.require (module.js:367:17)
at require (internal/module.js:16:19)
at Object. (build/webpack.config.js:32:5)
at Module._compile (module.js:413:34)
at Object.Module._extensions..js (module.js:422:10)
at Module.load (module.js:357:32)
at Function.Module._load (module.js:314:12)
at Module.require (module.js:367:17)
at require (internal/module.js:16:19)
at module.exports

2.1.3 runs without problems.

Most helpful comment

use CopyWebpackPlugin.default

All 11 comments

2.1.4 is broken :(

use CopyWebpackPlugin.default

using CopyWebpackPlugin.default resolved this for me.

I'm reverting the changes and pushing a new version, so this shouldn't be necessary. I'll investigate further this weekend

Installing 2.1.5 should resolve this

@kevlened It does, however my error was about the plugin not being a constructor?

I understand. I don't have time to investigate right now, so instead of blocking people on this issue, I pushed a fixed version.

It's ok, actually people only needed to revert to previous version instead of you pushing a revert but i guess that works too.

2.1.6 is now published and should fix the issue

I'm getting the same error after installing "copy-webpack-plugin": "^4.6.0",.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Jocs picture Jocs  路  4Comments

RPDeshaies picture RPDeshaies  路  5Comments

alexprice1 picture alexprice1  路  5Comments

gh67uyyghj picture gh67uyyghj  路  4Comments

ietabhi picture ietabhi  路  5Comments