This is due to the interfering messages
that come on to the page. There are multiple frames on the page which communicate with the page using window message event and object. few of them can be third party services like cookieq
for managing cookies, or may be cartwire
an e-com integration service.
You need to handle the onmessage event to check from where the messages are coming, and then parse the JSON accordingly.
I faced a similar problem, where one of the integration was passing a JSON object and other was passing a string starting with u