Duplicate id for the same dependency
See original GitHub issueI’m playing with Browserify and React today and in my bundle I’m noticing that React is loaded with 2 different dependency number. One is 158 and the other is 314.
In the bundle file, I can see this for 314
314:[function(require,module,exports){
arguments[4][158][0].apply(exports,arguments)
},{"./lib/React":187,"dup":158}]
158 is basically just a shortcut for module.exports = require('./lib/React');
which is 187.
My code is broken because of that, because it loads the dependency twice.
Issue Analytics
- State:
- Created 8 years ago
- Comments:12 (2 by maintainers)
Top Results From Across the Web
How can I get a maven build to fail on duplicate dependencies?
What this rule does is checking that there are no 2 duplicate declaration with the same 'dependencies.dependency.(groupId:artifactId:type: ...
Read more >Remove Duplicate Dependencies with Maven - Baeldung
Learn how to detect duplicate dependencies in Maven using the mvn dependency:tree and mvn dependency:analyze-duplicate commands.
Read more >Ban Duplicate Pom Dependency Versions - Apache Maven
Ban Duplicate Pom Dependency Versions. This rule checks that there are no duplicate dependencies declared in the POM of the project.
Read more >Detecting duplicate dependencies in Maven - Andres Almiray
Executing mvn verify from the IDE's terminal displays the same warning as before, after all, that's regular Maven thus no change in behavior ......
Read more >Learning the Basics - Gradle User Manual
Declaring multiple repositories is helpful if some dependencies are only available in one repository but not the other. You can mix any type...
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’m experiencing a similar issue with a module attempting to inject itself into jquery. Removing the duplicate jquery from the module’s node_modules/ directory solved the problem. That said, it seems like browserify recognizes that the packages are duplicated. Why couldn’t it (in the above instance) simply give 158 to the second package require()ing React instead of creating 314 to de-duplicate it?
@chrisirhc It makes no sense that I should have to manually enter the
node_modules
directory to symlink directories. When younpm install
npm resolves the dependencies itself, I should not have to go and manually change things. An example are the jquery plugins. Imagine you install 2 different jquery plugins, each jquery plugin might attach itself to a different jquery instance. This is exactly what you do not expect. This gets even worse as npm and jquery are saying that browserify is the way to go for these plugins, but this setup will simply not work if you use more than one plugin. Until I foundbrowserify-resolutions
browserify made itself unusable. This is critical and I am appalled that this issue was closed and letting this go on like that.