Oct 21, 2020
0
Level 16
Webpack error - Cannot read property 'thisCompilation' of undefined
I am using copy-webpack-plugin to copy my entire images folder from src to dist folder. I do not know what I am doing wrong. Can someone point it out?
snippet from webpack config
const CopyWebpackPlugin = require('copy-webpack-plugin');
module.exports = {
plugins: [
new CopyWebpackPlugin({
patterns: [{
rom: 'src/images',
to: 'dist/temp'
}]
})
]
}
npm error
TypeError: Cannot read property 'thisCompilation' of undefined
at CopyPlugin.apply (/opt/lampp/htdocs/gitwithravish/node_modules/copy-webpack-plugin/dist/index.js:338:20)
at Compiler.apply (/opt/lampp/htdocs/gitwithravish/node_modules/tapable/lib/Tapable.js:375:16)
at webpack (/opt/lampp/htdocs/gitwithravish/node_modules/webpack/lib/webpack.js:33:19)
at processOptions (/opt/lampp/htdocs/gitwithravish/node_modules/webpack/bin/webpack.js:335:15)
at yargs.parse (/opt/lampp/htdocs/gitwithravish/node_modules/webpack/bin/webpack.js:397:2)
at Object.Yargs.self.parse (/opt/lampp/htdocs/gitwithravish/node_modules/webpack/node_modules/yargs/yargs.js:533:18)
at Object.<anonymous> (/opt/lampp/htdocs/gitwithravish/node_modules/webpack/bin/webpack.js:152:7)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)
Documentation link https://webpack.js.org/plugins/copy-webpack-plugin/
Please or to participate in this conversation.