Uncaught SyntaxError: Unexpected token u in JSON at position 0

前端 未结 7 1451
[愿得一人]
[愿得一人] 2020-12-03 00:11

Only at the checkout and on individual product pages I am getting the following error in the console log:

VM35594:1 Uncaught SyntaxError: Unexpected token u          


        
7条回答
  •  北荒
    北荒 (楼主)
    2020-12-03 01:12

    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

提交回复
热议问题