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

Adding connect-js to page reassigns window._ to lodash v4.17.21 #191

Open
mikejacobson-MyTime opened this issue Oct 29, 2024 · 0 comments
Open

Comments

@mikejacobson-MyTime
Copy link

mikejacobson-MyTime commented Oct 29, 2024

I have a hybrid AngularJS/Angular app. To support the legacy code, window._ references Underscore.

However, when I make the call to loadConnectAndInitialize (which adds the connect-js library to the page because I'm importing it using @stripe/connect-js/pure), window._ is reassigned to reference Lodash (v4.17.21), which breaks our legacy code (Underscore has some methods that Lodash does not).

This is using connect-js v3.3.16.

Would it be possible to scope that reference within the connect-js library instead of rewriting _ on the window object?

Here's a StackBlitz demonstrating the issue:
https://stackblitz.com/edit/stackblitz-starters-5mcvnf?file=src%2Fmain.ts
Instructions are on its page.

@mikejacobson-MyTime mikejacobson-MyTime changed the title Calling loadConnectAndInitialize reassigns window._ to lodash v4.17.21 Adding connect-js to page reassigns window._ to lodash v4.17.21 Oct 29, 2024
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

1 participant