#kavo-react-errors

1 messages · Page 1 of 1 (latest)

zenith horizonBOT
hollow moon
#

Hi, where are you exactly seeing these? Can you add a bit more details here?

smoky rapids
#

certainly!

#

the stack trace isnt too helpful but starting out:

zenith horizonBOT
smoky rapids
#

a screenshot of where the client side stripe code errors ^

zenith horizonBOT
frigid totem
#

kavo-react-errors

smoky rapids
#

I am unfortunately unable to provide any more details on the "Each dictionary in the list "icons" should contain a non-empty UTF8 string field "type"." warning. I cant seem to determine where that warning originates but from reading through other discussions, it seems to be coming from the icons that get generated through the PaymentElement

frigid totem
#

@smoky rapids can you share

  1. Real code as text here instead of a picture
  2. An exact URL where we can reproduce this issue
smoky rapids
#

sure, would it be okay if I direct messaged you?

frigid totem
#

no please share here a simple repro, you can try on jsfiddle or similar if you don't want to share your real website's URL

smoky rapids
#

this is the bundled output in production via Stripe:

 key: "_setupPaymentRequest",
                    value: function(e) {
                        var t = this;
                        this._pr = null,
                        this._isShowing && (this._controller.event("pr-close"),
                        this._isShowing = !1),
                        this._controller._events.abort.off(),
                        this._controller._events.show.off(),
                        this._controller._events.update.off(),
                        this._paymentRequestOptions = e;
                        var n, r = K(this._authentication, this._paymentRequestOptions, null), a = r.details, s = r.options, u = r.methods;
                        if (O)
                            try {
                                this._pr = new O(u,a,s)
                            } catch (e) {}
frigid totem
#

Sorry I can't really read this

smoky rapids
#

the Empty total label may be confusing the user error is from this._pr = new O(u,a,s)

#

I am unable to provide a public link at this time, however I can message you a link privately

frigid totem
#

Sorry I'm helping other people too. I am trying to help you but would need you to spend a few minutes making a simple reproduction so that I can see what's happening

smoky rapids
#

generally speaking, where would a a label property need to be added? In stripe.retrievePaymentIntent(secret)? stripe.confirmPayment? The server side create-payaments-api?

frigid totem
#

I'm sorry I really don't follow you at all right now

#

There's no need to add a label, there's no API for it, it has to be something with the way you initialize PaymentElement, hence why I need to

  1. See your exact code
  2. See it live to help debug it
smoky rapids
#

okay thank you that is helpful

#
import { PaymentElement, useStripe, useElements } from '@stripe/react-stripe-js';

...

const stripe = useStripe();
const elements = useElements();

...

<PaymentElement options={{ layout: 'tabs' }} />
#
const CheckoutTransmissionForm: React.FC<CheckoutTransmissionFormProps> = ({ tier }): JSX.Element => {
  const stripe = useStripe();
  const elements = useElements();

  const [message, setMessage] = useState<null | string>();
  const [isLoading, setIsLoading] = useState<boolean>(false);

  useEffect(() => {
    if (!stripe) {
      return;
    }

    const secret = new URLSearchParams(window.location.search).get('payment_intent_client_secret');
    if (!secret) {
      return;
    }

    stripe.retrievePaymentIntent(secret).then(({ paymentIntent }) => {
      if (!paymentIntent) {
        setMessage('Something went wrong.');
        return;
      }
      switch (paymentIntent.status) {
        case 'succeeded':
          setMessage('Payment succeeded!');
          break;
        case 'processing':
          setMessage('Your payment is processing.');
          break;
        case 'requires_payment_method':
          setMessage('Your payment was not successful, please try again.');
          break;
        default:
          setMessage('Something went wrong.');
          break;
      }
    });
  }, [stripe]);

  const handleSubmit = async (e: FormEvent<HTMLFormElement>) => {
    e.preventDefault();

    if (!stripe || !elements) {
      // Stripe.js hasn't yet loaded so disable form submission until Stripe.js has loaded
      return;
    }

    setIsLoading(true);

    const { error } = await stripe.confirmPayment({
      elements,
      confirmParams: {
        return_url: `${new URL(window.location.href).origin}/payments/complete`,
      },
    });

    if (error.type === 'card_error' || error.type === 'validation_error') {
      setMessage(error.message);
    } else {
      setMessage('An unexpected error occurred.');
    }

    setIsLoading(false);
  };

  return (
    <form onSubmit={handleSubmit}>
      ...
      <PaymentElement options={{ layout: 'tabs' }} />
      ...
    </form>
  )
#

would be happy to share with you the link privately

frigid totem
#

😅

#

Sorry I keep waiting for you to spend a few minutes making the most basic example online so I can look at it so that I can help you

smoky rapids
#

you asked for code which I have given, and I will happily provide you with a live link to help debug it

frigid totem
#

Right now there's nothing in your code that could explain this. You don't use the Appearance API or do anything fancy that I can see. But you refuse to share a simple link publicly which is totally fair but you can spend a few minutes making the most basic repro on jsbin or jsfiddle or similar so that you can show the issue

smoky rapids
#

it seems to be a niche issue that I am only seeing in production. Again I would be happy to provide you with the link privately. The screenshots are taken directly from Stripe code that gets bundled in production from "@stripe/react-stripe-js": "^2.4.0", and "@stripe/stripe-js": "^2.2.0"

frigid totem
#

sure DM me the link, we're running in circles so ¯_(ツ)_/¯

#

I don't plan to sign up or do anything, sorry that's why I need a simple repro and not an entirely complex website to just see a bug

#

Please make sure to provide an exact end to end repro with all the information needed so that I can help you

smoky rapids
#

there is no need to create your own account. I have sent you the details which is just two clicks total

#

I would really appreciate the help, this has been bugging me for a couple of weeks now

frigid totem
#

I can't seem to edit your code or see it. All I see is a log with payments:1 and no info

smoky rapids
#

can you see the error I had detailed prior which links directly to Stripe code?

frigid totem
#

Well I see the error you mentioned but it points to payments:1 with no info

smoky rapids
#

that isnt an error, thats a warning

#

Im referring to the error in red that points to _setupPaymentRequest

frigid totem
#

No I don't see that

smoky rapids
#

clicking on the top right of the error would direct you to the bundled _setupPaymentRequest code

frigid totem
#

Sure but I don't get that error on load at all

smoky rapids
#

ah interesting, may be browser dependent

#

I see it on Chrome

frigid totem
#

I'm in Chrome,don't see it on load

#

might be because of some Chrome extension(s) you have? Try disabling them all first

smoky rapids
#

interesting behavior

#

I just tried incognito with no extensions (latest chrome)

#

and see the error

frigid totem
smoky rapids
#

woah!

#

yes I do

frigid totem
#

thanks that helps, sorry I should have started there, the way you framed it I thought it was an integration issue on your end or something

#

So not sure what it is, I think you can just safely ignore but I'll flag internally

smoky rapids
#

sorry I should have been a bit more detailed and broadened my experience

#

is there a ticket that I can add details to?

#

may help in some way?

frigid totem
#

no

#

Can you share your exact OS + Chrome version?

smoky rapids
#

sure!

#

here is a better screenshot showing me navigating to Stripe (the link provided) and showcasing the exact error I am seeing as well as the warnings:

frigid totem
#

are you using some kind of custom mode to make the page appear as mobile or responsive?

smoky rapids
#

Chrome is up to date
Version 119.0.6045.159 (Official Build) (arm64)

#

regarding the link I shared?

frigid totem
#

Regarding the way you debug mostly, I'm just asking if you changed the view in CDT

smoky rapids
#

sorry what do you mean by CDT?

#

I am not using anything custom, I just navigated to the link your provided, ensured my extensions were disabled, opened dev tools, refreshed the page, and took a screenshot

frigid totem
#

Chrome Developer Tool

smoky rapids
#

no custom profilers / toggles were done on my side

frigid totem
#

sounds good. So really for now I would just simply ignore. It doesn't break anything, it's just a console error and I flagged internally

smoky rapids
#

cool thank you sir. I assumed I could disregard the warnings but the error was throwing me off a bit

frigid totem
#

yep totally fair it's confusing where internal scripts like this raise an error. It's coming straight from Google's API in Chrome but we'll look into it. Just tricky when we can't reproduce

smoky rapids
#

yeah the warnings seem to be related to google pay, the "Empty total label may be confusing the user" seems to be stemming from internal _setupPaymentRequest stripe code

frigid totem
#

yep