React错误收集

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

3. react-dom.js:103 Error: Minified React error #130; visit https://reactjs.org/docs/error-decoder.html?invariant=130&args[]=undefined&args[]= for the full message or use the non-minified dev environment for full errors and additional helpful warnings

大概率是组件render中某个组件,import到的组件为空。原因是文件中没有组件,或者该组件没有被webpack编译

posted @   全玉  阅读(1589)  评论(0编辑  收藏  举报
编辑推荐:
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· AI技术革命,工作效率10个最佳AI工具
点击右上角即可分享
微信分享提示