This repository was archived by the owner on Jul 27, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 77
Type 'FriendlyErrorsWebpackPlugin' is not assignable to type 'WebpackPluginInstance'.Β #130
Copy link
Copy link
Open
Description
"@types/friendly-errors-webpack-plugin": "0.1.3",
"@types/webpack": "^5.28.0",
"@types/webpack-dev-server": "3.11.1",
"@types/webpack-merge": "^5.0.0",
"webpack-cli": "^4.3.1",
"webpack-dev-server": "^3.11.2",
"webpack-merge": "^5.7.3",
"webpackbar": "^5.0.0-3"
"friendly-errors-webpack-plugin": "^1.7.0",
"typescript": "^4.1.3",
configuration
const commonConfig: Configuration = {
......
......
plugins: [
new WebpackBar({
name: 'Project',
// react blue
color: '#61dafb',
}),
new FriendlyErrorsPlugin(),
new HtmlWebpackPlugin({
minify: __DEV__ ? false : htmlMiniFierOptions,
cache: false,
template: path.resolve(PROJECT_ROOT, './public/index.html')
}),
// new HardSourceWebpackPlugin()
]
}
Got this error:
error TS2322: Type 'FriendlyErrorsWebpackPlugin' is not assignable to type '((this: Compiler, compiler: Compiler) => void) | WebpackPluginInstance'.
Type 'FriendlyErrorsWebpackPlugin' is not assignable to type 'WebpackPluginInstance'.
Types of property 'apply' are incompatible.
Type '(compiler: import("/Users/liyiming22/ts-react/node_modules/@types/friendly-errors-webpack-plugin/node_modules/@types/webpack/index").Compiler) => void' is not assignable to type '(compiler: import("/Users/liyiming22/ts-react/node_modules/webpack/types").Compiler) => void'.
Types of parameters 'compiler' and 'compiler' are incompatible.
Property '_pluginCompat' is missing in type 'import("/Users/liyiming22/ts-react/node_modules/webpack/types").Compiler' but required in type 'import("/Users/liyiming22/ts-react/node_modules/@types/friendly-errors-webpack-plugin/node_modules/@types/webpack/index").Compiler'.
116 new FriendlyErrorsPlugin(),
~~~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/@types/friendly-errors-webpack-plugin/node_modules/@types/webpack/index.d.ts:1466:9
1466 _pluginCompat: SyncBailHook<compilation.Compilation>;
~~~~~~~~~~~~~
'_pluginCompat' is declared here.
diescake and aFcFzF
Metadata
Metadata
Assignees
Labels
No labels