How to fix customer-data.js:86 Uncaught Error: [object Object] in Magento 2?

Table of Content

customer-data-js-86-uncaught-error-fix
0 comments

You may encounter the customer-data.js:86 Uncaught Error: [Object Object] in different situations, but most of them will be due to improperly disabling some extension, such as the payment module, without clearing the local/storage cache of the browser.

Inside this cache is a specific call to this module that cannot be processed, so it returns a JS error.

How to debug the customer-data.js:86 Uncaught Error: [object Object]?

Method 1  

You can find the error while checking the XHR request in DevTools.

The XHR request path is likely: /customer/section/load/ 

You can see this error like this:

responseText: "Exception: Warning: Cannot modify header information - headers already sent by ..."

Method 2

Also you can try to do the following:

To debug this error add 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);

            throw new Error(jqXHR);

        });


This way you can find the error cause and the place to make changes. 

Try clearing the local/storage cache of your browser. This simple step may help you solve the issue.

Do not hesitate to ask in the comments below if you still have questions about this error and its debugging.

November 29, 2022
December 1, 2022
November 18, 2022
Comments
Leave your comment

Your email address will not be published

This blog was created with Amasty Blog Pro

This blog was created with Amasty Blog Pro