Skip to content

Magento 2.4.5 Uncaught TypeError: Cannot read properties of undefined (reading ‘set’)

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);