2

After click button ADD TO CART , it's error Cannot read properties of undefined (reading 'remove') enter image description here

and mini cart is empty too enter image description here

enter image description here

1 Answer 1

2

It seems Magento Bug https://github.com/magento/magento2/issues/31920

Please update this fix in your customer-data.js file https://github.com/magento/magento2/commit/5983e1733d56b1b2f15fb4f0e64094a3a4f3145d

Override customer-data.js by copying vendor/magento/module-csutomer/view/frontend/web/js/customer-data.js to your theme app/design/frontend/VendorName/Themename/Magento_Customer/web/js/customer-data.js

Then update the Magento's github commits

Just remove the "remove" function and add the "initstorage" function

initStorage: function () {
            $.cookieStorage.setConf({
                path: '/',
                expires: new Date(Date.now() + parseInt(options.cookieLifeTime, 10) * 1000)
            });
            storage = $.initNamespaceStorage('mage-cache-storage').localStorage;
            storageInvalidation = $.initNamespaceStorage('mage-cache-storage-section-invalidation').localStorage;
        },

Note: You are using Welpixel Custom module that already overrides the customer-data.js You can update the customer-data.js by adding it here app/design/frontend/VendorName/Themename/Weltpixel_Custom/web/js/customer-data.js

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.