Magento – Magento2 : customer-data.js:86 Uncaught Error: [object Object]

customererrormagento-2.1

enter image description herecustomer-data.js:86 Uncaught Error: [object Object]

at Object. (customer-data.js:86)

at fire (jquery.js:3099)

at Object.fireWith [as rejectWith] (jquery.js:3211)

at done (jquery.js:9312)

at XMLHttpRequest.callback (jquery.js:9720)

Best Answer

Sometimes this is caused by something as disabling a (payment) module the wrong way and RLTcode's answer is very useful.

However, in my case the mini cart was not updated when a product was added. No errors in system.log, debug.log or anywhere else. But this error kept popping up.

In the end I added a console.log to the pub/static/version.../frontend/Magento/luma/en_US/Magento_Customer/js/customer-data.js to show the jqXHR error:

return $.getJSON(options.sectionLoadUrl, parameters).fail(function (jqXHR) {
            console.log(jqXHR); // around line 90...
            throw new Error(jqXHR);
        });

This revealed the error that I was looking for :

responseText: "Exception: Warning: Cannot modify header information - headers already sent by ..." caused by a module I had installed.

So if anyone ever runs into some weird behavior without any errors but this customer-data.js:90 Uncaught Error: [object Object] keeps popping up then add some console logging to the jqXHR error: it can help a lot!