Closed HenKun closed 3 years ago
Hi @HenKun , for this issue and https://github.com/amzn/amazon-payments-magento-2-plugin/issues/974, we would need more details from you in order to proceed with the investigation. Can you contact us at payments-cp-devel@amazon.com and provide a staging URL where these 2 issues occur?
Thanks Best Christian
Hi @HenKun , this error should be solved with the PR we just merged: https://github.com/amzn/amazon-payments-magento-2-plugin/pull/990 please let us know if you still see the error
Thanks Best Christian
What I expected
No JS errors
What happened instead
Sometimes (but often), one can see JS error in console:
Pretty printed the error occurs on line 9727 in
Widget.js
:void 0 !== l().Login.Metrics)
l()
refers to line 6286 inWidget.js
window.amazon
is null in this case.window.amazon
is set bylogin.js
, so I guess there is a timing problem somewhere.If I break before the line and try to debug slowly, the error does not occur, probably because
login.js
was executed meanwhile.Steps to reproduce the issue
Happens sometimes (often) on any page, where an Amazon button is rendered. (doesn't matter if logged in or out of Amazon)
Note: I don't see any obvious failures that result from this JS error.
Your setup