@types/webpack-merge doesn't work with webpack v5
See original GitHub issueNot sure if this is the correct place, or if I should create this issue in DefinitelyTyped.
I get the following issue:
node_modules/@types/webpack/index.d.ts:32:3 - error TS2305: Module '"../../tapable/tapable"' has no exported member 'Tapable'.
32 Tapable,
~~~~~~~
node_modules/@types/webpack/index.d.ts:1062:23 - error TS2707: Generic type 'SyncWaterfallHook<T, AdditionalOptions>' requires between 1 and 2 type arguments.
1062 resolver: SyncWaterfallHook;
It is similar to this issue: https://github.com/DefinitelyTyped/DefinitelyTyped/issues/49528#issuecomment-732849209
I can reproduce it here: https://github.com/nzjony/copy-webpack-plugin-types-typescript-test/blob/types-webpack-merge-issue/test.ts
Simply git clone the https://github.com/nzjony/copy-webpack-plugin-types-typescript-test/tree/types-webpack-merge-issue branch and run npm install && npm run build to reproduce the error.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
webpack-merge - npm
webpack -merge provides a merge function that concatenates arrays and merges objects creating a new object. If functions are encountered, it will ...
Read more >To v5 from v4 - webpack
This guide aims to help you migrating to webpack 5 when using webpack directly. If you are using a higher level tool to...
Read more >How to Fix Webpack Merge Is Not a Function - Future Studio
This tutorial shows you how to fix the Webpack merge error not being a function. The Problem: Webpack Merge Is Not a Function....
Read more >webpack-merge | Yarn - Package Manager
webpack -merge provides a merge function that concatenates arrays and merges objects creating a new object. If functions are encountered, it will execute...
Read more >webpack-merge/CHANGELOG.md - UNPKG
The CDN for webpack-merge. ... Throw a `TypeError` if trying to use `mergeWithRules` with invalid configuration types for ... 76, ## 5.0.9 /...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Can you open this issue at copy-webpack-plugin repository or DefinitelyTyped? webpack-merge doesn’t depend on webpack types directly so we cannot fix the issue here.
@nzjony Maybe that’s the problem. webpack-merge comes with types and you shouldn’t use @types/webpack-merge as that’s obsolete.