React js Firebase error

Im using react js and firebase firestore and it gives this error

Unhandled Rejection (FirebaseError): Function DocumentReference.set() called with invalid data. Unsupported field value: undefined (found in document users/tDJ1zI9JWwakZdq5CkFh/orders/pi_1ILaCRDbKBqU3OnKnhbGH0Dv)

here’s the code that is giving error according to the chrome

  }).then(({ paymentIntent }) => {
  51 |            // paymentIntent = payment confirmation
  52 | 
> 53 |            db.collection('users').doc(user?.uid).collection('orders').doc(paymentIntent.id).set({
     | ^  54 |                  basket: basket,
  55 |                  amount: paymentIntent.amount,
  56 |                  created: paymentIntent.created
 event.preventDefault();
  44 |        setProcessing(true);
  45 | 
> 46 |        const payload = await stripe.confirmCardPayment(clientSecret, {
     | ^  47 |            payment_method: {
  48 |                card: elements.getElement(CardElement)
  49 |            }

db is the firebase details like api key and stuff.

here is an image of that error

Hey there,

how does your orders model look like in Firebase?

hey miku i updated my question with more info can you solve it now?

No, it seems you just added an image of the error,
but the error message is already known.

The error says DocumentReference.set() called with invalid data. Unsupported field value: undefined.

This probably means, that one of your values (basket, amount or created) is undefined.

To find out how to solve this, we should know which data orders can be (= the model).

Bro have you solved this error if you do solve this error please also help me to solve this error same issue in my code

oguzhanefe32 have you solved this error

Yeah this means that there are fields within your firebase firestore that are not created but you are calling them in your Reactjs code. For example you are calling a field called name from your Reactjs but no such field exists in your firestore document
Hope this helps