braintree / braintree-web

A suite of tools for integrating Braintree in the browser
https://developer.paypal.com/braintree/docs/start/hello-client/javascript/v3
MIT License
444 stars 134 forks source link

Failed to execute 'postMessage' on 'Window' since yesterday (v2 braintree.js) #698

Closed eXorus closed 1 year ago

eXorus commented 1 year ago

General information

Issue description

I have a SaaS application that has been working well since 2016 with Laravel Spark and Braintree. I haven't made any changes, but since yesterday, I've had customers complaining that they can't change their payment method or subscribe.

When you visit https://mailcare.io/register, you can indeed see the JavaScript error in the console.

In Firefox, the error is:

Uncaught DOMException: An invalid or illegal string was specified
    send https://js.braintreegateway.com/v2/braintree.js:5
    reply https://js.braintreegateway.com/v2/braintree.js:5
    e https://js.braintreegateway.com/v2/braintree.js:5
    initialize https://js.braintreegateway.com/v2/braintree.js:7
    _handleRequest https://js.braintreegateway.com/v2/braintree.js:5
    o https://js.braintreegateway.com/v2/braintree.js:3
    receive https://js.braintreegateway.com/v2/braintree.js:5
    o https://js.braintreegateway.com/v2/braintree.js:3
    apply moz-extension://269fc820-18ac-4cda-91ee-232545fbb261/content/pageScripts/dashlane-tiresias-page-script.js:1
    i https://js.braintreegateway.com/v2/braintree.js:3
    i https://js.braintreegateway.com/v2/braintree.js:5
    s https://js.braintreegateway.com/v2/braintree.js:7
    i https://js.braintreegateway.com/v2/braintree.js:7
    r https://js.braintreegateway.com/v2/braintree.js:7
    i https://js.braintreegateway.com/v2/braintree.js:7
    c https://js.braintreegateway.com/v2/braintree.js:3
    36]</</o/c[s https://js.braintreegateway.com/v2/braintree.js:3
    <anonymous> https://api.braintreegateway.com/merchants/q6b755bb8r2td5fh/client_api/v1/configuration?authorizationFingerprint=eyJ0eXAiOiJKV1QiLCJhbGciOiJFUzI1NiIsImtpZCI6IjIwMTgwNDI2MTYtcHJvZHVjdGlvbiIsImlzcyI6Imh0dHBzOi8vYXBpLmJyYWludHJlZWdhdGV3YXkuY29tIn0.eyJleHAiOjE2OTYwNzMwMDcsImp0aSI6IjUyMTY0ZWVlLWYzMjYtNGMwMS05NzIwLTlkZmYxODZmN2EwMCIsInN1YiI6InE2Yjc1NWJiOHIydGQ1ZmgiLCJpc3MiOiJodHRwczovL2FwaS5icmFpbnRyZWVnYXRld2F5LmNvbSIsIm1lcmNoYW50Ijp7InB1YmxpY19pZCI6InE2Yjc1NWJiOHIydGQ1ZmgiLCJ2ZXJpZnlfY2FyZF9ieV9kZWZhdWx0IjpmYWxzZX0sInJpZ2h0cyI6WyJtYW5hZ2VfdmF1bHQiXSwic2NvcGUiOlsiQnJhaW50cmVlOlZhdWx0Il0sIm9wdGlvbnMiOnt9fQ.S5V0MWZC9Oi13O0mTr7WhdQl60NlMvjJELgtE1i-nZvS8odpZ7iHJ0oRD_JWy-2Dt4HakwQW-VPlQwm1w_RS-Q&callback=callback_json8af4e6bbe018461184b81ac98f4f39da:1
2 braintree.js:5

In Chrome, the error is:

braintree.js:5 Uncaught DOMException: Failed to execute 'postMessage' on 'Window': Invalid target origin 'window.parent' in a call to 'postMessage'.
    at i.send (https://js.braintreegateway.com/v2/braintree.js:5:1828)
    at i.Message.reply (https://js.braintreegateway.com/v2/braintree.js:5:2399)
    at e (https://js.braintreegateway.com/v2/braintree.js:5:4643)
    at https://js.braintreegateway.com/v2/braintree.js:7:26488
    at i._handleRequest (https://js.braintreegateway.com/v2/braintree.js:5:4735)
    at Object.handler (https://js.braintreegateway.com/v2/braintree.js:3:12889)
    at i.receive (https://js.braintreegateway.com/v2/braintree.js:5:1781)
    at https://js.braintreegateway.com/v2/braintree.js:3:12889
i.send @ braintree.js:5
i.Message.reply @ braintree.js:5
e @ braintree.js:5
(anonymous) @ braintree.js:7
i._handleRequest @ braintree.js:5
(anonymous) @ braintree.js:3
i.receive @ braintree.js:5
(anonymous) @ braintree.js:3
Capture d’écran 2023-09-29 à 13 24 37
hollabaq86 commented 1 year ago

👋 V2 of the Braintree JS SDK is Unsupported as of February 2023 and has not had a release since 2016. We recommend updating your integration to v3 as soon as possible. For more information, please see our deprecation policy or contact Support.