You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unhandled Rejection (FirebaseError): Function DocumentReference.set() called with invalid data. Unsupported field value: undefined (found in document users/tDJ1zI9JWwakZdq5CkFh/orders/pi_1ILaCRDbKBqU3OnKnhbGH0Dv)
#23
Open
haroon437 opened this issue
Apr 18, 2021
· 2 comments
So the bug of "Function DocumentReference.set()" basically means there's some sort of data inside the set() function that is undefined, i suggest you take a look at the data you're passing, in this case
each part of the data related to basket (and every child of it meaning the items that you pass to the basket in the context api/redux) and each of the items children/props, and basically i think paymentIntent values should be fine
So the bug of "Function DocumentReference.set()" basically means there's some sort of data inside the set() function that is undefined, i suggest you take a look at the data you're passing, in this case
each part of the data related to basket (and every child of it meaning the items that you pass to the basket in the context api/redux) and each of the items children/props, and basically i think paymentIntent values should be fine
THANK YOU SO MUCH.
For everyone stuck with this error, remove these lines of code one by one and proceed with your payment.
Yes there is an error in of these lines. In my case it was the basket. I forgot to put an id in the basket long way back. ( I got to know this by logging basket at various stages in the app). So I had to go back to home.js and put the id. This was an absolute stupid error from my side, you might have done something similar.
The error in the Payment.js section where we using no sql db.collection('users') if anyone solve this erorr pls help me
import React, { useState, useEffect } from 'react'
import "./Payment.css";
import { useStateValue } from "./StateProvider";
import CheckoutProduct from "./CheckoutProduct"
import { Link, useHistory } from "react-router-dom"
import { CardElement, useStripe, useElements } from "@stripe/react-stripe-js";
import CurrencyFormat from 'react-currency-format';
import { getBasketTotal } from "./reducer";
import axios from './axios';
import { db } from "./firebase";
function Payment() {
const [{ basket, user, }, dispatch] = useStateValue();
const history = useHistory();
}
export default Payment
The text was updated successfully, but these errors were encountered: