#krystsina_code
1 messages ¡ Page 1 of 1 (latest)
đ 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/1242406688817025055
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi, let me help you with this.
Do you know which exact line produces the error?
It doesn't seem like it comes directly from Stripe
Hello, it is coming from v3 file which is from stripe https://js.stripe.com/v3. I can't find the line but if you search for receiveMessageFromChild, you can see it
What if you move const stripePromise = loadStripe(stripeKey) outside of React components?
I already tried it, didn't help... I also tried to load in useEffect
Do you have a live website where I can reproduce the issue?
It seems like the code is trying to parse an HTTP response, but fails sice it's not a JSON. Do you see what request might be causing this in your dev tools?
I am not sure I am eligible to share the website link here...I also don't see the request that could be related to error because the number of errors is much bigger than requests and error is thrown very often. I can send what is coming in e.data, could it help?
Sure
The first several events look good, they are stringified, for example '{"initMessage":true,"channel":"hcaptcha-invisible"}' and '{"type":"init","id":1,"channel":"hcaptcha-invisible"}'. But then such events are coming (I stringified it manually in order to pass it here) '{"securityKey":"10d9b72b077dbe5a59aa6adcba44b6433e25f8d82f6c80d20397610a1f403a15","performance":{"memory":{"usedJSHeapSize":156473265}},"storageEstimate":{"quota":299977904946,"usage":228,"usageDetails":{"cookieSize":36,"localStorageSize":192}}}'
Do these errors actually prevent you from accepting payments?
I see. How does it look in your console? Could you please share a screenshot?
I removed some unrelated code
const options: StripePaymentElementOptions = {
fields: { billingDetails: 'never' },
};
export default function CardModal() {
const stripe = useStripe();
const elements = useElements();
const isMobile = useIsMobile();
const content = (
<div className={styles.paymentElementWrapper}>
<PaymentElement id="payment-element" options={options} />
<Image
src="src"
alt="Stripe logo"
className={styles.stripeLogo}
width={106}
height={24}
/>
</div>
);
return isMobile ? (
<BottomSheet>
{content}
</BottomSheet>
) : (
<Modal>
{content}
</Modal>
);
}
Can you remove the <CardModal /> component and load the page, do you see the same errors?
I can see an error with empty Elements
I wonder if it's related to memoizing the appearance const
I can remove the appearance for test
Nope, this hasn't helped... do you know from where the last event in message is coming #1242406688817025055 message ?
What do you mean 'where is it coming from'? It's likely the response from an event/analytical API call Stripe.js is making back to our API (for fraud prevention etc)
then why isn't data in this event coming as a string? given that this event also from stripe
One last thing, can you try in an incognito window and/or disable and third-party browser extensions?
Seeing similar reports of this internally related to some Chrome extensions. Suspect they're interfering with the request(s) somehow
You may have extensions running still in incognito
Outside of that, I'd recommend you write in to us so we can spend some time debugging this further and include a URL a reproduction of the issue. I can't reproduce this error with similar code, so I suspect this is likely specific to your system/browser
https://support.stripe.com/contact/email?topic=api_integration
Find help and support for Stripe. Our support site provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
I guess it could be related to browser/extensions. In Edge I don't see an error. Thanks! I will write in support then