Html-webpack-plugin: TypeScript error with Webpack 5: error TS2724: Module '"../webpack/types"' has no exported member 'compilation'

Created on 11 Oct 2020  ·  6Comments  ·  Source: jantimon/html-webpack-plugin

$ ls
$ npm i html-webpack-plugin typescript webpack
…
+ [email protected]
+ [email protected]
+ [email protected]
added 192 packages from 182 contributors and audited 192 packages in 12.586s
…
$ echo 'import HtmlWebpackPlugin = require("html-webpack-plugin")' > webpack.config.ts
$ npx tsc webpack.config.ts
node_modules/html-webpack-plugin/typings.d.ts:2:20 - error TS2724: Module '"../webpack/types"' has no exported member 'compilation'. Did you mean 'Compilation'?

2 import { Compiler, compilation } from 'webpack';
                     ~~~~~~~~~~~


Found 1 error.

Most helpful comment

Released in [email protected]

All 6 comments

The problem is that we want to support webpack 4 and webpack 5.

Unfortunately that's not possible for this breaking change.. we will need to write a new dedicated webpack 5 version to solve your issue.

Can you please see if this is fixed with [email protected] ?
Please see also #1527

Not in 5.0.0-alpha.3, although it may be fixed in 44621d892ad544d2a0c27e7642dd973c417a6ae6.

Released in [email protected]

Yeah, seems to work. Thanks!

Thanks for reporting and testing 👍

Was this page helpful?
0 / 5 - 0 ratings

Related issues

amorphius picture amorphius  ·  3Comments

mmjamal picture mmjamal  ·  3Comments

rokoroku picture rokoroku  ·  3Comments

lonelyclick picture lonelyclick  ·  3Comments

klinki picture klinki  ·  3Comments