#max-react-error
1 messages · Page 1 of 1 (latest)
hmm let me quickly make a vercel deployment for you
click on basket top right
then the stripe logic should get triggered
looking
thanks
@tall oar is taking over and investigating
thanks guys
Hi there, give me a sec to get caught up
So it looks like your app is successfully GETing the Elements Session: https://dashboard.stripe.com/test/logs/iar_V8xpMlmChaYmE6
That's what I would expect based on what little is rendering.
hmm okay so looks good from stipe perspective
so maybe the loading state is nto getting updated?
loading to => done
Could be. Give that a shot
should get that from the useElement hook no?
Real quick: have you been able to get this to load outside of an i-frame?
Ah, wait. Nvm. This isn't an i-frame
well I gues the PaymentElement is an iframe no?
the PaymentElement fires the onLoarderStart event but never the onReady event
maybe Im feeding the wrong stripe secret in to the load stripe function? pk_test_51NmiGnK... is the correct one no?
I assume that's in the right place, since it's reaching your Stripe account (i.e. you have request logs in your account showing that the request was successful).
Can you do a console.log(); of the client secret to make sure it's actually there?
yep its there
It's showing in the network log that, but I wonder if it's actually present when the form renders
{clientSecret && (
<Elements stripe={getStripe()} options={{ clientSecret }}>
{modalContent}
</Elements>
)}
thats the logic
so I would assume
otherwise I would get an error when elements dont have a client secret and me trying to use a <PaymentElement />
also I see some PaymentIntents in my dashboard so on this side we are good
Im suspecting an Iframe issue. Because of some CSP configuration, next js is blocking the request to js.stripe.com
but dont see anything in the network tab
Can you try loading it outside of a flex container and also outside of an i-frame to see if that changes anything?
Right, I thought you meant you had implemented an i-frame that I had missed during my once-over of the HTML. Scratch that then
no worries mate
Do you have access to view/modify the CSP of this app? Can you check to make sure i-frames are not being blocked?
oh wow I got it
Oh?
the error was because I injected my modal right afgter the html element
<html lang="en">
<ModalContextProvider>
<Providers>
<body className={inter.className}>{children}</body>
</Providers>
</ModalContextProvider>
</html>
Warning: validateDOMNesting(...): <div> cannot appear as a child of <html>.
which makes sense
but this error was throwing off stripe
Ah! Man... I can't believe I missed that too.
now with the body directly under the HTML ```
<html lang="en">
<body className={inter.className}>
<ModalContextProvider>
<Providers>{children}</Providers>
</ModalContextProvider>
</body>
</html>
its all good
stupid me
well anyway. Thanks for the support 🙂
It's always the simplest answers that require the deep-dives 🤦♀️
Anyway, I'm glad you got it working!