#eagle-stripejs-conflict
1 messages · Page 1 of 1 (latest)
Hi 👋
Could you explain more thoroughly what you are referring to?
Hello, sorry for the abrupt description. We're dealing with an ongoing issue seemingly caused by a newly surfaced conflict on websites with Google Translate and Stripe.
I'm gathering the details. Will share in a sec.
really odd, so looks like the latest version of google translate has an inline/embedded version of a gzip library
we happen to load StripeJSv3 using requirejs as an amd
so Google Translate's new embedded gzip module ends up trying to define itself with requirejs as an anonymous module at the same time as we're loading StripeJSv3 and defining it as a requirejs shim
bizarre that google would embed this gzip lib, almost feels like a malicious unauthorized update on Google's end
Unfortunately I cannot offer any help about this. If this is an issue with incompatability between Google Translate and Stripe.js I recommend writing in to Support. We will need to investigate async and that will allow you to get updated once we have some answers
understood, at first it seemed that Google introduced a new global variable called Stripe, so i figured it would be an actively discussed issue since the problem surfaced just last night
That's an understandable worry, I just won't be able to troubleshoot in real time here.
@crude comet do you have a live page with a basic example I can look at? I can always flagged internally to see if we can do something about it (though unlikely)
eagle-stripejs-conflict
TE_20231203 - doesn't use define.amd
https://web.archive.org/web/20231207081052/https://translate.google.com/translate_a/element.js?cb=
TE_20231206 - uses define.amd
https://translate.google.com/translate_a/element.js?cb=
the issue is difficult to replicate since the loading timing of StripeJS and Google Translate has to coincide, i've been able to replicate with a 100ms latency network throttle in Chrome, but surprising we've received quite a few reports from customers
Sure but if you can provide a really basic page that loads those 2 libs specifically and renders something that would help narrow it down
also providing the exact error in the console + callstack
will do
would there be any plans to add amd based initialization to StripeJS, it would solve such issues directly, since we wouldn't have to use a shim definition of a globally defined library
I don't think we have plans for this anytime soon
sharing a jsfiddle example in a min
do you have a clear error message in the meantime
also is there no way to do a simple repro on your own domain with the most basic things? Jsfiddle is noisy for things like this as it loads a lot of over things
Test your JavaScript, CSS, HTML or CoffeeScript online with JSFiddle code editor.
it's just a single self contained html file, you can grab it from there
there's no specific error since the entire Stripe object isn't what you'd expect, it's Google's gzip module instead
so calling new Stripe("a") throws a Stripe is not a constructor error
if you just refresh the page, you'll see sometimes it works, sometimes it doesn't, depending on the timing
if it wasn't for the pci requirement to load the stripe js from you guys, we'd fix it directly
ah yeah I can repro
for now we'll just remove define.amd from requirejs to avoid 3rd party libraries trying to use it
@heavy garnet @junior ice thank you for looking into it
Of course, thanks for the report and the clear repro. I'm dubious we can do anything here but I flagged to the product team that owns Stripe.js to look into mitigations