question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

@types/webpack-merge doesn't work with webpack v5

See original GitHub issue

Not 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:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
bebrawcommented, Nov 24, 2020

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.

On 24.11.2020, at 13:39, Jonathan Stichbury notifications@github.com wrote:

Not 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: DefinitelyTyped/DefinitelyTyped#49528 (comment)

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.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

0reactions
bebrawcommented, Nov 24, 2020

@nzjony Maybe that’s the problem. webpack-merge comes with types and you shouldn’t use @types/webpack-merge as that’s obsolete.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found