FormidableLabs / inspectpack

An inspection tool for Webpack frontend JavaScript bundles.
MIT License
591 stars 20 forks source link

TypeScript error with webpack 5.x #161

Closed yoavain closed 3 years ago

yoavain commented 3 years ago

Getting the following error after updating from 4.6.1 to 4.7.0

Error: webpack.config.find-duplicates.ts(8,9): error TS2322: Type 'DuplicatesPlugin' is not assignable to type 'WebpackPluginInstance | ((this: Compiler, compiler: Compiler) => void)'.
  Type 'DuplicatesPlugin' is not assignable to type 'WebpackPluginInstance'.
    Types of property 'apply' are incompatible.
      Type '(compiler: ICompiler) => void' is not assignable to type '(compiler: Compiler) => void'.
        Types of parameters 'compiler' and 'compiler' are incompatible.
          Property 'plugin' is missing in type 'Compiler' but required in type 'ICompiler'

Here's a link to my PR that fails: https://github.com/yoavain/webpack-playground/pull/401/checks?check_run_id=2185910775

ryan-roemer commented 3 years ago

@yoavain Thanks for the issue and reproduction! Can you try out inspectpack@4.7.1 which has a fix and confirm that solves the issue for you?

yoavain commented 3 years ago

Build passed: https://github.com/yoavain/webpack-playground/pull/401/checks?check_run_id=2187714594 Thanks for the quick fix!