Page MenuHomePhabricator

Handle JS ReferenceError: AdyenCheckout is not defined
Closed, ResolvedPublic

Description

Saw with 157350993.1 in T324362: Adyen iframe config error messages Q2 2022: the sequel

error-20221231.gz:Dec 30 20:07:56 payments1005 adyen_gateway: 157350993:157350993.1 Client side error: Array ( [message] => ReferenceError: AdyenCheckout is not defined

Resulted in

157350993.png (724×465 px, 46 KB)

Thoughts from discussing with ejegg:
it could be load order - let's make sure our script that tries to use it only runs after that script is loaded
I don't see us using mw.loader.load() anywhere in adyen.js
it could possibly be a load order issue!
so we call new AdyenCheckout() in some code that runs on page ready
and I've forgotten whether pageReady is before or after all the other JS loads
SO says nope: https://stackoverflow.com/questions/16983774/is-document-ready-called-after-loading-all-script-files-in-the-body
so yeah, we should do something about that!

Event Timeline

Change 881050 had a related patch set uploaded (by Ejegg; author: Ejegg):

[mediawiki/extensions/DonationInterface@master] Adyen: ensure external script loads first

https://gerrit.wikimedia.org/r/881050

Change 881050 merged by jenkins-bot:

[mediawiki/extensions/DonationInterface@master] Adyen: ensure external script loads first

https://gerrit.wikimedia.org/r/881050

XenoRyet set Final Story Points to 2.