adrianhajdin / project_e_commerce

This is a code repository for the corresponding video tutorial. In this video, we're going to build a fully functional eCommerce application using commerce.js.
https://jsmastery.pro
1.88k stars 507 forks source link

TypeError: Cannot read properties of undefined (reading 'total_items') #60

Open si-dadi opened 2 years ago

si-dadi commented 2 years ago

image

I downloaded the source code and runned it, which works fine. But changing the env variables with my own API keys and running gives this error. Any Idea how to resolve this issue?

crimsoncreates commented 2 years ago

I also have this issue anyone know the solution?

ghost commented 2 years ago

i have been battling with this issues more than 3 hours ago, but there is something i get to observe, after console.loging my cart state, in the console, i observed, despite fetching my fetchCart function in useEffects, my website renders multiple time, like 3-4 times, while the api is still pending or fetching, i observed my my cart state, shows its return values but on api fulfillment, my cart state returned undefined...

crimsoncreates commented 2 years ago

someone pls figure this out and help us lol

Uwill18 commented 1 year ago

Visit this post: https://github.com/adrianhajdin/project_e_commerce/issues/63