@Alex_87

Ошибка от webpack: TypeError: compiler.plugin is not a function?

добрый вечер! Подскажите пожалуйста, что это за ошибка?

[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


Папка проекта: https://dropmefiles.com/kyNmE
  • Вопрос задан
  • 6732 просмотра
Пригласить эксперта
Ответы на вопрос 2
@Russo2
Что бы вам могли помочь, необходимо видеть содержимое package.json и webpack.config
Ответ написан
Комментировать
jlekapb
@jlekapb
.do
Видимо вы используете webpack@5, но плагин extract-text-webpack-plugin еще не обновлен, поэтому и падает сборка

Plugins in webpack 5 are now applies 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...
Ответ написан
Комментировать
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Похожие вопросы