I get the following error in the console. It doesn't matter if I'm logged in or not:
Uncaught TypeError: Cannot create property 'checkout-data' on string '{"cart":1498083338,"directory-data":1498083338,"zopim-chat":1498083338,"customer":1498083338,"compare-products":1498083338,"last-ordered-items":1498083338,"wishlist":1498083338,"paypal-billing-agreement":1498083338,"messages":1498083338,"review":1498083338}'
at customer-data.js:163
Magento version 2.1.5 in production but also on 2.1.7 in development
Website is hosted with Byte.
In Chrome 58 on Mac (this might be a Mac + Chrome only issue, I did not test on other environments)
At points 2, 3 you could see an error in your console.
At point 4 you will not see the checkout.
The error is random, it can be 5x no error and then all the time..
No errors in console and a checkout page which is loading.
I traced the issue back in vendor/magento/module-customer/view/frontend/web/js/customer-data.js on line 159 data is retrieved from the cookie storage.
This data is sometimes an object and sometimes a string.
This should not be a string, so to make sure it is an object as fix, I added on line 160:
if (typeof sectionDataIds == 'string') sectionDataIds = JSON.parse(sectionDataIds);
Unfortunately I could not reproduce this issue. We need more information about your configuration to reproduce this issue. Please identify the web server you are running, the versions of PHP and MySQL, and any other information needed to reproduce your issue.
@Tantuss, thank you for your report.
We were not able to reproduce this issue by following the steps you provided. If you'd like to update it, please reopen the issue.
We tested the issue on 2.1.9
I am also getting this issue on 2.1.9. Tantuss code fixed the problem. Please merge this.