“SyntaxError: Unexpected token < in JSON at position 0”

前端 未结 30 1949
花落未央
花落未央 2020-11-22 04:39

In a React app component which handles Facebook-like content feeds, I am running into an error:

Feed.js:94 undefined \"parsererror\" \"SyntaxError: Un

30条回答
  •  执笔经年
    2020-11-22 05:41

    This error occurs when you define the response as application/json and you are getting a HTML as a response. Basically, this happened when you are writing server side script for specific url with a response of JSON but the error format is in HTML.

提交回复
热议问题