Giter Club home page Giter Club logo

Unhandled Rejection (FirebaseError): Function DocumentReference.set() called with invalid data. Unsupported field value: undefined (found in document users/tDJ1zI9JWwakZdq5CkFh/orders/pi_1ILaCRDbKBqU3OnKnhbGH0Dv) about react-challenge-amazon-clone HOT 2 OPEN

cleverprogrammers avatar cleverprogrammers commented on July 24, 2024
Unhandled Rejection (FirebaseError): Function DocumentReference.set() called with invalid data. Unsupported field value: undefined (found in document users/tDJ1zI9JWwakZdq5CkFh/orders/pi_1ILaCRDbKBqU3OnKnhbGH0Dv)

from react-challenge-amazon-clone.

Comments (2)

bhavy007 avatar bhavy007 commented on July 24, 2024 3

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

basket: basket,
amount: paymentIntent.amount,
created: paymentIntent.created

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.

basket: basket,
amount: paymentIntent.amount,
created: paymentIntent.created

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.

from react-challenge-amazon-clone.

Eliot6001 avatar Eliot6001 commented on July 24, 2024

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

basket: basket,
amount: paymentIntent.amount,
created: paymentIntent.created

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

from react-challenge-amazon-clone.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.