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 sometimes loads and overwrites _, breaking various modules #142

Open
tophtucker opened this issue Jan 13, 2017 · 3 comments
Open

Comments

@tophtucker
Copy link
Collaborator

tophtucker commented Jan 13, 2017

screen shot 2017-01-13 at 6 52 29 pm

_.functions is not a function
_.contains is not a function
_.flatten is not a function

_.VERSION
"4.13.1"

This usually but not always happens. Looks like a recent version of Lodash removed contains as an alias. Seems like sometimes Lodash loads and overwrites this version of Underscore. But I can't figure out how Lodash is even getting on the page lol.

I can take more of a look later.

cc @aubergene @blacki <3

@1wheel 1wheel closed this as completed in c5d3f65 Jan 25, 2017
@tophtucker
Copy link
Collaborator Author

Well wait now we broke the video hahaha

[BVP] BloombergVideoPlayer: TypeError: _.cloneDeep is not a function
    at new e (app.js:4)
    at Function.value (app.js:4)
    at t.value (app.js:5)

And I think @1wheel's fix is a race condition thing, so like 1 in 20 times the video works and nothing else does. (I shoulda grabbed the log that 1 time out of 20 but it basically just looked like before the fix...)

@tophtucker tophtucker reopened this Mar 7, 2017
@tophtucker
Copy link
Collaborator Author

I guess there's no way to exactly future-proof this when it's loading arbitrary ad code, but I feel like we should bite the bullet and do a big find-and-replace with a _.noConflict() rename to something other than _...

@1wheel
Copy link
Collaborator

1wheel commented Mar 7, 2017

what about:

!(function(){
  var orginalUnderscore = _
  d3.timer(function(){
    _.groupBy = orginalUnderscore.groupBy
    _.flatten = orginalUnderscore.flatten
  })
})();

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

No branches or pull requests

2 participants