Skip to content
Advertisement

Stripe: ERR_BLOCKED_BY_RESPONSE

I’m getting error function redirectToCheckout doesn’t exist. But when I try adding stripe in script tag. It displays this error. This error is happening on stripe script tag in index.html. But even after adding this script tag redrirectToCheckoutout is not a function error still exists.

ERROR

JavaScript

Index.html

JavaScript

Server.js

JavaScript

Api.js

JavaScript

Advertisement

Answer

On the parcel GitHub repo there is an issue describing the same issue we have. However the issue is closed on 21 Jun 2021, I currently do not see the solution being merged in a PR. Issue #6499

The solution:

In your project folder (in this particular case for the WDS project the client folder) create a .proxyrc.js and put the following code in:

JavaScript

This is working for me. My index.html is now able and allowed in load sources from other domains. There might be another solution in the near future if this is still a parcel bug.

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement