7

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)

Ravindrasinh Zala
  • 2,125
  • 3
  • 14
  • 46

2 Answers2

12

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!

Isolde
  • 441
  • 3
  • 13
  • This is good. The XHR request path is likely: /customer/section/load/ which can be checked in DevTools. – bassplayer7 Feb 27 '19 at 22:48
  • Hi @Isolde, I added this to the customer-data.js and refreshed cache in Magento but it doesn't appear to have updated the customer-data.js file. Can you advise? When it finally does work, where will I find the log? I am using Chrome. – YorkieMagento Mar 18 '19 at 16:18
  • Try cleaning out var/view_preprocessed/pub/static/frontend (if you have added the logging in an extension in stead of in the javascript in de cache) cache and/or do a new setup:static-content:deploy. Also note that your browser may be caching the javascript files! So clean browser cache if needed as well. In chrome -> developer tools you will find a tab named console, logs will be shown there. – Isolde Mar 19 '19 at 18:33
3

See my answer for a different question concerning the same issues:

https://magento.stackexchange.com/a/213550/14403

RLTcode
  • 863
  • 8
  • 21