Also warn if the same version is included multiple times
See original GitHub issueIt’s possible for webpack to bundle multiple instances of a module even if the versions are the same. For example, here’s a partial webpack stats output I saw in my project just now. Notice how the WorkboxError
module is included 6 times because the paths are different (even though the versions are the same):
[19] ./node_modules/workbox-precaching/node_modules/workbox-core/_private/WorkboxError.mjs 1.42 kB {0} [built]
[23] ./node_modules/workbox-strategies/node_modules/workbox-core/_private/WorkboxError.mjs 1.42 kB {0} [built]
[24] ./node_modules/workbox-broadcast-cache-update/node_modules/workbox-core/_private/WorkboxError.mjs 1.42 kB {0} [built]
[26] ./node_modules/workbox-cache-expiration/node_modules/workbox-core/_private/WorkboxError.mjs 1.42 kB {0} [built]
[28] ./node_modules/workbox-background-sync/node_modules/workbox-core/_private/WorkboxError.mjs 1.42 kB {0} [built]
[31] ./node_modules/workbox-routing/node_modules/workbox-core/_private/WorkboxError.mjs 1.42 kB {0} [built]
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:7 (2 by maintainers)
Top Results From Across the Web
c++ - Header file included twice despite #ifndef - Stack Overflow
However, it seems that it is included multiple times, as I got an error that operator << was defined multiple times. I then...
Read more >Hooks + multiple instances of React · Issue #13991 - GitHub
My hooks are only used in the body of functional components and I do not have two versions of react running (per the...
Read more >Need to include one file multiple times, how to avoid warning
I get some warnings when I include one public file in several other files in a same package. It is straightforward to include...
Read more >warnings — Warning control — Python 3.11.1 documentation
If two or more threads use the catch_warnings context manager at the same time, the behavior is undefined. When testing multiple operations that...
Read more >Using LD, the GNU linker - Command Line Options
See the -( option for a way to force the linker to search archives multiple times. You may list the same archive multiple...
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 FreeTop 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
Top GitHub Comments
I can get you a full set of steps to reproduce the issue later, but off the top of my head here’s how you can do it:
That will install those packages as well as
workbox-core
@ version3.0.1
. Then you run the following:That will force npm to put a version of
workbox-core
inside each of the above packagesnode_modules
folder.Then if you create a bundle the imports the 6 above packages, you’ll see
workbox-core
modules (e.g.WorkboxError.mjs
included multiple times.@caseycarroll42 : Consider the following issue package A -> package B 1.0.0 Package B 2.0.0 In this particular case, as there are breaking changes between the two versions of the packages (assuming they are properly semantic versioned), resolving to the root level package will not be desirable.
Additionally, my understanding is that the purpose of this particular plugin is to alert developers of potential duplications (both major and minor version changes) in their webpack configurations so that you can go ahead and add alias’s like your solution. Hence the reason for an option to check for duplications in the same version.