A
A
Alex_872020-10-19 18:50:58
webpack
Alex_87, 2020-10-19 18:50:58

Error from webpack: TypeError: compiler.plugin is not a function?

good evening! Please tell me what is this error?

[webpack-cli] TypeError: compiler.plugin is not a function
    at ExtractTextPlugin.apply (C:\Users\Admin\Desktop\myNewWebpack\node_modules\extract-text-webpack-plugin\dist\index.js:147:16)
    at createCompiler (C:\Users\Admin\Desktop\myNewWebpack\node_modules\webpack\lib\webpack.js:71:12)
    at create (C:\Users\Admin\Desktop\myNewWebpack\node_modules\webpack\lib\webpack.js:115:15)
    at webpack (C:\Users\Admin\Desktop\myNewWebpack\node_modules\webpack\lib\webpack.js:139:31)
    at f (C:\Users\Admin\Desktop\myNewWebpack\node_modules\webpack\lib\index.js:35:15)
    at WebpackCLI.createCompiler (C:\Users\Admin\Desktop\myNewWebpack\node_modules\webpack-cli\lib\webpack-cli.js:219:24)
    at WebpackCLI.run (C:\Users\Admin\Desktop\myNewWebpack\node_modules\webpack-cli\lib\webpack-cli.js:248:31)
    at async runCLI (C:\Users\Admin\Desktop\myNewWebpack\node_modules\webpack-cli\lib\bootstrap.js:76:24)
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! mynewwebpack@1.0.0 build: `webpack`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the mynewwebpack@1.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Admin\AppData\Roaming\npm-cache\_logs\2020-10-19T15_30_12_067Z-debug.log

C:\Users\Admin\Desktop\myNewWebpack>

C:\Users\Admin\Desktop\myNewWebpack>npm run build

> mynewwebpack@1.0.0 build C:\Users\Admin\Desktop\myNewWebpack
> webpack

[webpack-cli] TypeError: compiler.plugin is not a function
    at ExtractTextPlugin.apply (C:\Users\Admin\Desktop\myNewWebpack\node_modules\extract-text-webpack-plugin\dist\index.js:147:16)
    at createCompiler (C:\Users\Admin\Desktop\myNewWebpack\node_modules\webpack\lib\webpack.js:71:12)
    at create (C:\Users\Admin\Desktop\myNewWebpack\node_modules\webpack\lib\webpack.js:115:15)
    at webpack (C:\Users\Admin\Desktop\myNewWebpack\node_modules\webpack\lib\webpack.js:139:31)
    at f (C:\Users\Admin\Desktop\myNewWebpack\node_modules\webpack\lib\index.js:35:15)
    at WebpackCLI.createCompiler (C:\Users\Admin\Desktop\myNewWebpack\node_modules\webpack-cli\lib\webpack-cli.js:219:24)
    at WebpackCLI.run (C:\Users\Admin\Desktop\myNewWebpack\node_modules\webpack-cli\lib\webpack-cli.js:248:31)
    at async runCLI (C:\Users\Admin\Desktop\myNewWebpack\node_modules\webpack-cli\lib\bootstrap.js:76:24)
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! mynewwebpack@1.0.0 build: `webpack`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the mynewwebpack@1.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Admin\AppData\Roaming\npm-cache\_logs\2020-10-19T15_35_51_403Z-debug.log


Project folder: https://dropmefiles.com/kyNmE

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Russo2, 2020-12-21
@Russo2

To help you, you need to see the contents of package.json and webpack.config

J
jlekapb, 2020-12-29
@jlekapb

Apparently you are using [email protected], but the extract-text-webpack-plugin has not been updated yet, which is why the build is crashing

Plugins in webpack 5 are now applied before the configuration defaults has been applied. This allows plugins to apply their own defaults, or act as configuration presets.
But this is also a breaking change as plugins can't rely on configuration values ​​to be set when they are applied

https://webpack.js.org/blog/2020-10-10-webpack-5-r...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question