Files getting erroneously deduped when using fullPaths.
Closed this issue · 8 comments
#917 introduced a bug where certain files get erroneously deduped. For example if you have an index.js
that's just module.exports = require('./lib')
in multiple libraries, they all get deduped to the first occurrence of the file. So, you end up requiring the wrong lib
in the other libraries.
/test_library_one
/lib
index.js // module.exports = require('./lib')
/test_library_two
/lib
index.js // module.exports = require('./lib')
In this case, the bundle entry for /test_library_two/index.js
ends up being
"/path/to/test_library_two/index.js":[function(require,module,exports){
module.exports=require("/path/to/test_library_one/index.js")
}
which ends up requiring test_library_one
's /lib
into test_library_two
.
I first noticed this with https://github.com/hapijs/joi. Browserify 5.12.0 works, but 5.12.1 breaks. It also works fine without using fullPaths, but watchify requires that option.
Just ran into this problem with React when I upgraded to browserify@6.0.3, browserify 5.12.0 works.
Seem to be running into the same issue.
Is there a way to implement caching without relying on fullPaths
?
Any progress on this? Basically makes watchify useless with new versions of browserify.
I'm in a tight spot where 5.12.0 (without dedupe) will fix this issue, but it will break my require statements with gsap. Upgrading to 5.12.1 (with dedupe) will fix the gsap statements, but will break other require statements. :(
Problematic commit: dd66c40 by @blazzy
Also not sure if this is related to #994 but it doesn't seem to fix my case.
I just ran into this issue as well, as @mattdesl said, this makes watchify useless right now. I've also created a test project using watchify
which reproduces this problem:
https://github.com/saschagehlich/watchify-test
Why don't we just dedupe the files by not adding the deps to the bundle at all, like this?
https://github.com/saschagehlich/node-browserify/commit/af7bbe0080642b69b0903ca00440e3683b06fffc
This looks like the same deduping bug #1027 that was just fixed in 8.0.0. Can anyone confirm?
@substack i just did some tests with old code and this bug seems resolved as of version 8.
Unfortunately it looks like #914 is not related to this fix, as it's still broken. 😢
@substack Still failing for me - see my last comment in this issue. :(