1. Uncaught Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports
這個錯誤,最常見的問題是import組件出錯。例如,
import { com } from 't-com' //寫成了 import com from 't-com'
或者
import com from 't-com' //寫成了 import { com } from 't-com'
2. JSON.parse()報錯 Unexpected token o in JSON at position 1
錯誤原因
1. 后端返回數據類型錯誤,前端解析報錯,查看接口返回數據來排除
2. 本地存儲中存在非法字符,使用隱身模式chrome窗口來排除
3. JSON.parse將一個非法的值或已經是Object的值二次parse