Reaction Commerce Forums

Shopping Cart (BUG?)- Cannot read property 'id' of null

  1. You add “Sample Product” to the shopping cart.
  2. You delete this “Sample Product” with admin panel.
  3. You Refresh shopping cart and get this err.
  7 |  * @param {Object} cartItem Object of the `CartItem` type
   8 |  * @returns {Object} Data suitable for tracking a `CartItem`
   9 |  */
> 10 | export default function getCartItemTrackingData(cartItem) {
  11 |   const variant = { ...cartItem };
  12 |   let url;

How to avoid when You want delete product as Admin but some customer have this product in shoping cart saved in LocalStorage. In my way It caused BUG. Because when you delete product as admin this product remains in Shopping Cart and dont remove automatically. So anytime when You hover mouse on shopping Cart this item try to load but dont exist and it causes crash. Why when you deleting product as admin he not remove automatically from localStorage or from ShoppingCart too. It is bug or only my mistake? What can I do? Thanks for any reply))

Hi @Niko0918!

This surely looks like a bug. Could you file a GitHub issue for that?