magento2: 2.0.9 : customer-data.js:49 Uncaught Error: [object Object]
Issue description
I get the following error in the console. It doesn’t matter if I’m logged in or not or if I have any products in my cart:
customer-data.js:49 Uncaught Error: [object Object]
Steps to reproduce
- Open Chrome (version 52 at the moment of writing).
- Go to a product detail page.
- Add to the cart.
- Refresh the page.
Watch the console.
Expected result
No error in the console
Actual result
Error in the console:
customer-data.js:49 Uncaught Error: [object Object](anonymous function)
@ customer-data.js:49 fire
@ jquery.js:3099 fireWith
@ jquery.js:3211 done
@ jquery.js:9312 callback
@ jquery.js:9720
Additional information
Prior before the error a XHR request throws a 400 error (http://www.domain.com/customer/section/load/?sections=paypal-billing-agreement&update_section_id=false&_=1472630495115). This results a valid JSON object:
{"message":"\"paypal-billing-agreement\" section source is not supported"}
I think the 400 error status results the exception to be thrown in customer-data.js
. I’m not sure if this is an issue with Magento, my PSP (MultisafePay) or the OnePageCheckout module I’m using.
Did anyone else encounter this problem is well?
Edit: When I disable the PSP and Checkout plugin, the error still persists, which makes sense because it never showed up before.
Edit 2: When I also disable Magentos’ Braintree and Paypal plugin, the error still persists. Which is odd. Also, I noticed that in an incognito window I don’t get the error.
Edit 3: It doesn’t happen in incognito mode. For some reason, the ‘regular’ mode makes an extra XHR request that triggers the error.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 19 (5 by maintainers)
GOT IT!
It turns out that
customer-data.js
uses the localStorage to store a variety of stuff (probably for caching purposes). This means that when a module (or Magento) updates, you’d better make sure to flush your local storage as well, because otherwise you’re in a world of debugging-hurtSame issue on 2.1.6, how to fix?
@kanduvisla I can clear my local storage after an upgrade, no problem. But how to tell every customer using the shop to clear his local storage?