[Browser error resolution record] SyntaxError: Unexpected non-whitespace character after JSON at position 7

The page that was displayed normally before suddenly has no data. The check request returns 200, and then the console reports an error:

 After checking and checking, I found out that the data format of the backend has changed. I used JSON.parse to do the conversion, but the backend changed the data format and did not tell me, which caused me to send the data that is not in json format. The data uses JSON.parse, so the browser will report this error.

[Solution] You only need to carefully check where the json format conversion is used on the page where the error is reported, and then check whether the data source is in json format. If it is not in JSON format, do not use parse to convert it, and make corresponding adjustments.

Guess you like

Origin blog.csdn.net/wzy_PROTEIN/article/details/129663054