Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Files getting erroneously deduped when using fullPaths. #940

Closed
jkyle opened this issue Oct 9, 2014 · 8 comments
Closed

Files getting erroneously deduped when using fullPaths. #940

jkyle opened this issue Oct 9, 2014 · 8 comments

Comments

@jkyle
Copy link

jkyle commented Oct 9, 2014

#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.

@RnbWd
Copy link

RnbWd commented Oct 12, 2014

Just ran into this problem with React when I upgraded to [email protected], browserify 5.12.0 works.

@timkurvers
Copy link

Seem to be running into the same issue.

Is there a way to implement caching without relying on fullPaths?

@mattdesl
Copy link
Contributor

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.

@saschagehlich
Copy link

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

@ghost
Copy link

ghost commented Dec 24, 2014

This looks like the same deduping bug #1027 that was just fixed in 8.0.0. Can anyone confirm?

@mattdesl
Copy link
Contributor

@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. 😢

@ghost ghost closed this as completed Dec 24, 2014
@saschagehlich
Copy link

@substack Still failing for me - see my last comment in this issue. :(

@Delagen
Copy link

Delagen commented Feb 25, 2015

Still not fixed due #1007

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

6 participants