react 谷歌浏览器报错:Uncaught TypeError: Cannot read properties of undefined (reading ‘forEach‘)

运行react项目,报错:

Uncaught TypeError: Cannot read properties of undefined (reading 'forEach')
    at Object.injectIntoGlobalHook (react-refresh-runtime.development.js:488)
    at Object../node_modules/@pmmmwh/react-refresh-webpack-plugin/client/ReactRefreshEntry.js (ReactRefreshEntry.js:17)
    at Object.options.factory (react refresh:6)
    at __webpack_require__ (bootstrap:24)
    at startup:4
    at startup:7

解决办法:

第一种: 将谷歌浏览器的扩展程序关闭,重启项目

第二种:找到报错行,将其注释掉,保存文件,重启项目

猜你喜欢

转载自blog.csdn.net/u010234868/article/details/124380800
今日推荐