React踩坑日记React启动后报错TypeError Cannot read properties of undefined (reading ‘forEach‘)

简介: React踩坑日记React启动后报错TypeError Cannot read properties of undefined (reading ‘forEach‘)

前言今天创建新项目运行后又出现这个问题了,之前也出现过,觉得是很正常的情况,不过我今天发现还有许多朋友不知道这个问题的解决方法,特地来记录一下。

话不多说 上图:

这个情况呢是由于你的浏览器安装了React-DevTools扩展程序的原因,安装这个东西是为了方便我们查看React元素和编译之后的一些代码,很多朋友是直接删除了,但是这不就等于是壮士断腕了嘛。解决方法如下:

1.进入项目中按照路径找到相应的文件

/node_modules/@pmmmwh/react-refresh-webpack-plugin/client/ReactRefreshEntry.js

2.

注释后重新npm start 报错解决的同时React-DevTools也能用

相关文章
|
定位技术
vue-baidu-map 报错 | map is undefined
vue-baidu-map 报错 | map is undefined
309 1
|
JavaScript
VUE——filemanager-webpack-plugin报错TypeError: Cannot read property 'isFile' of undefined
VUE——filemanager-webpack-plugin报错TypeError: Cannot read property 'isFile' of undefined
516 0
|
JavaScript 前端开发
报错:Cannot read properties of undefined (reading ‘$message‘)解决方法
以上就是解决"Cannot read properties of undefined (reading ‘$message‘)"错误的几种方法,希望对你有所帮助。
7591 0
|
前端开发 小程序 JavaScript
微信小程序-Unhandled promise rejection TypeError: Cannot read property ‘get‘ of undefined
微信小程序-Unhandled promise rejection TypeError: Cannot read property ‘get‘ of undefined
|
存储 JavaScript 前端开发
成功解决:Cannot read properties of undefined (reading ‘commit‘)
这篇文章提供了解决Vuex中"Cannot read properties of undefined (reading 'commit')"错误的两种方法:检查模板中的数据属性是否存在,以及确保在Vue实例中正确挂载了store对象。
成功解决:Cannot read properties of undefined (reading ‘commit‘)
|
定位技术 Apache
Echarts——Invalid geoJson format Cannot read property 'length' of undefined
Echarts——Invalid geoJson format Cannot read property 'length' of undefined
361 0
|
前端开发 JavaScript
VUE——Uncaught (in promise) TypeError: Cannot read property '__esModule' of undefined
VUE——Uncaught (in promise) TypeError: Cannot read property '__esModule' of undefined
539 0
webpack版本问题 Cannot read property ‘createHash‘ of undefined
webpack版本问题 Cannot read property ‘createHash‘ of undefined
383 1
TypeError: Cannot set properties of undefined (setting ‘resdata‘),res定义数据出现的问题,定义的方法用this换成that
TypeError: Cannot set properties of undefined (setting ‘resdata‘),res定义数据出现的问题,定义的方法用this换成that