I have tis issue with the customer-data Javascript object. Her is (a par of my code)
define([
'jquery',
"Magento_Customer/js/customer-data"
], function ($, customerData) {
'use strict';
return function (config, element) {
customerData.reload(customerData.getExpiredSectionNames(), true).then(
function () {
let group = customerData.get('customer')();
//do stuff after getting customer data
}
);
}
});
I now the code can be approved by checking if the customer section needs a reload, but that is not the problem.
The code works fine in Chrome, but in Firefox I get the following error:
TypeError: options is undefined
The options get used in the getExpiredSectionNames() function on following line:
sectionLifetime = options.expirableSectionLifetime * 60
I guess this has to do with loading order of the javascript files.
So I tried moving the customer.customer.data
block in de default.xml but that didn't work either.
Is there a way I can insert the options in the customer-data object from my custom js script? Or do I need to add somthing in my requirjs-config.js file?