hygraph / hygraph-commerce-starter

https://commerce.withheadlesscms.com
MIT License
173 stars 67 forks source link

Runtime Error on Product UI Page #29

Open tommyready opened 2 years ago

tommyready commented 2 years ago

Main page loads fine, I can see my product grid but when navigating to a product I get the following error:

Unhandled Runtime Error
TypeError: Cannot read properties of undefined (reading 'id')

Any help would be great because debugging this is a nightmare. I assumed it couldn't read product.id but I ran the query in the playground and I see the ID is returned in the response.

tommyready commented 2 years ago

FYI: this error only happens on newly added products to graphCMS. The ones from the template work just fine.

sorokinvj commented 2 years ago

in my case its because this: Screenshot 2022-07-16 at 14 53 38

I am not sure if variant is something all the products need? could it be that there are no variants of the product? I guess then activeVariantId = product.id?