#rishabhpanwar_error

1 messages ยท Page 1 of 1 (latest)

quiet lintelBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

๐Ÿ”— This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1294392240231157912

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

iron cloudBOT
tame sinew
#

Looking at the error though, is that encountered whenever you load Stripe.js or only if your code makes it to redirectToCheckout?

unkempt kettle
#

Its when I do:

const stripe = await loadStripe(process.env.NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY!);

tame sinew
#

Ah, gotcha, so it's when loading our script. Does your site currently use a COEP policy? Stripe.js currently doesn't have the necessary headers to work there if so.

unkempt kettle
#

Yes, I have this:

{
key: "Cross-Origin-Embedder-Policy",
value: "require-corp",
},

tame sinew
#

Yup, I'm pretty sure that's what is leading to this. Currently we don't return a crossorigin attribute or a CORP.

unkempt kettle
#

Let me try and remove this.

#

Yes this worked. Others who faced this before, did they remove this entirely or used some other setting?

#

Thanks!

tame sinew
#

Glad to hear that helped! I'm not exactly sure how others have handled this, or whether there is a less-strict policy that you can use rather than removing it completely.