Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeScript error with Webpack 5: error TS2724: Module '"../webpack/types"' has no exported member 'compilation' #1526

Closed
andersk opened this issue Oct 11, 2020 · 6 comments

Comments

@andersk
Copy link

andersk commented Oct 11, 2020

$ 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.
@jantimon
Copy link
Owner

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.

@jantimon
Copy link
Owner

jantimon commented Oct 16, 2020

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

@andersk
Copy link
Author

andersk commented Oct 16, 2020

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

@jantimon
Copy link
Owner

Released in [email protected]

@andersk
Copy link
Author

andersk commented Oct 16, 2020

Yeah, seems to work. Thanks!

@andersk andersk closed this as completed Oct 16, 2020
@jantimon
Copy link
Owner

Thanks for reporting and testing 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants