#krystsina_code

1 messages ¡ Page 1 of 1 (latest)

inland tangleBOT
#

👋 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.

solar drumBOT
visual epoch
#

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

fierce flame
#

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

visual epoch
#

What if you move const stripePromise = loadStripe(stripeKey) outside of React components?

fierce flame
#

I already tried it, didn't help... I also tried to load in useEffect

visual epoch
#

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?

fierce flame
#

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?

visual epoch
#

Sure

fierce flame
#

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}}}'

visual epoch
#

Do these errors actually prevent you from accepting payments?

fierce flame
#

no

#

they just create a lot of errors in console and logged in sentry

visual epoch
#

I see. How does it look in your console? Could you please share a screenshot?

fierce flame
inland tangleBOT
tough geyser
#

Taking a look

#

What does <CardModal /> look like?

fierce flame
#

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>
);
}

tough geyser
#

Can you remove the <CardModal /> component and load the page, do you see the same errors?

fierce flame
#

I can see an error with empty Elements

tough geyser
#

I wonder if it's related to memoizing the appearance const

fierce flame
#

I can remove the appearance for test

tough geyser
#

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)

fierce flame
#

then why isn't data in this event coming as a string? given that this event also from stripe

tough geyser
#

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

fierce flame
#

I tried in chrome incognito and I can see an error

#

let me try another browser

tough geyser
#

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

fierce flame
#

I guess it could be related to browser/extensions. In Edge I don't see an error. Thanks! I will write in support then