dayhaysoos / use-shopping-cart

Shopping cart state and logic for Stripe
MIT License
907 stars 118 forks source link

Sku required error #296

Closed chrissysemens closed 1 year ago

chrissysemens commented 1 year ago

Hey all,

I've installed use-shopping-cart at current version 3.1.2.

On attempting to add an item to a cart, I'm getting an error stating sku is missing in my props:

image

This is strange in itself as I can see in the typings that there's a union between id and other items: image

When I log my product out on the same onClick the product has a valid id: image

Just wondered if anyone can spot anything I'm doing wrong or if anyone has experienced a similar problem.

Thanks in advance.

chrissysemens commented 1 year ago

I've resolved this. I was actually missing some price info, but the error was misleading.