3

I have updraded Magento from 2.4.0 to 2.4.5 and now in the product page, there's an error: Uncaught TypeError: Cannot read properties of undefined (reading 'set')

update: function (sections) {
        var sectionId = 0,
            sectionDataIds = $.cookieStorage.get('section_data_ids') || {};

        _.each(sections, function (sectionData, sectionName) {
            sectionId = sectionData['data_id'];
            sectionDataIds[sectionName] = sectionId;
            storage.set(sectionName, sectionData);
            storageInvalidation.remove(sectionName);
            buffer.notify(sectionName, sectionData);
        });
        $.cookieStorage.set('section_data_ids', sectionDataIds);
    },

line 167 in file Magento_Customer/js/customer-data.js

storage.set(sectionName, sectionData);
2
  • Any luck solving this? I have the exact same error but on checkout page which just has spinning wheel and a blank page.
    – Baber
    Commented Mar 2, 2023 at 11:44
  • May be this could fix the error magento.stackexchange.com/a/213550/78366 Commented Mar 10, 2023 at 16:09

1 Answer 1

1

Afternoon all,

I found the cause for my issue for the same error on step 1 of the checkout with a patchable solution, please see the links below:

Useful information and debugging help: Uncaught TypeError: Cannot read property 'remove' of undefined -- upgrade from 2.3.4 to 2.4.1

Resolved my issue by applying patch from: https://github.com/magento/magento2/pull/31940/files

The issue is caused by customer-data.js file which the above git hub patch updates. I hope this update helps anyone with a similar issue.

1
  • Just to confirm that applying this patch worked for me. Thanks for this information! Commented Oct 3, 2023 at 14:57

Your Answer

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

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