I have tis issue with the customer-data Javascript object. Her is (a par of my code)


], 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?

2 Answers 2


Suppose you have an error in your customer/section/load endpoint. What does return http://your-localhost/customer/section/load ?

  • First, thanks for the info I didn't know you could view customer data from this url. Secondly, it shows the data correctly so that is not the problem. Commented Oct 4, 2019 at 7:51

I finally found an answer. It was because I didn't add my dependencies in requirejs file.


var config = {
    paths: {
        custom_js: 'js/custom',
    shim: {
        custom_js: ['jquery', 'Magento_Customer/js/customer-data']

I still find it strange that Chrome did load the dependencies correctly, but I'm happy I found a solution.

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.