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

lodash 4 overwrites global _ variable even when browserified #1852

Closed
Macil opened this issue Jan 20, 2016 · 2 comments
Closed

lodash 4 overwrites global _ variable even when browserified #1852

Macil opened this issue Jan 20, 2016 · 2 comments

Comments

@Macil
Copy link

Macil commented Jan 20, 2016

Lodash v4 overwrites the global _ variable even when browserified.

This caused issues for me because I have an application which depends on the global _ being Lodash v3, and one of my browserified dependencies updated to depend on Lodash v4 recently.

I see from #1798 that this looks intentional, but I'm still unclear how I can make a module/library like https://github.com/AgentME/contain-by-screen use lodash v4 without having it overwrite the global _.

I can't have my library call _.noConflict() on the Lodash object, because if the application is also using Lodash v4, then require('lodash') in the library will get me the same instance of Lodash that the application is using and unset the global that it might be depending on. (Also, if the library had multiple entry points that could be required, then all of them that required lodash would each have to remember to call _.noConflict().)

Macil added a commit to Macil/contain-by-screen that referenced this issue Jan 20, 2016
Macil added a commit to InboxSDK/InboxSDK that referenced this issue Jan 20, 2016
@jdalton
Copy link
Member

jdalton commented Jan 21, 2016

Dup of #1798.

@lock
Copy link

lock bot commented Dec 28, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Dec 28, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

2 participants