chec / commercejs-nextjs-demo-store

Commerce demo store built for the Jamstack. Built with Commerce.js, Next.js, and can be one-click deployed to Netlify. Includes product catalog, customer login, categories, variants, cart, checkout, payments (Stripe) order confirmation, and printable receipts.
https://commercejs-demo-store.netlify.app/
BSD 3-Clause "New" or "Revised" License
1.07k stars 206 forks source link

Error handling for categories #105

Closed jaepass closed 4 years ago

jaepass commented 4 years ago

The main issue is in _app.js when matching data.slug to item.slug in order to merge the category images into the category data. I've tested doing the full manual setup process of seeding and then changing categories, if no match of slugs, the category banner will just render the image that matches otherwise, it will be an empty array. not sure if this is the best way for error handling.

robbieaverill commented 4 years ago

I've had to revert this, I couldn't see why, but this was causing build failures (https://app.netlify.com/sites/commercejs-demo-store/deploys/5f7dec61210e3b000807dc4b). It is reproducible by running yarn deploy locally. Without these changes it builds correctly.

jaepass commented 4 years ago

yea that was what caused the initial build failure and points to this https://reactjs.org/docs/error-decoder.html/?invariant=143. will need another way of handling this error (the original category bug)