react 踩坑记录
报错:
Uncaught TypeError: Cannot read properties of undefined (reading ‘forEach’)
at Object.injectIntoGlobalHook (react-refresh-runtime.development.js:488:1)
at Object…/node_modules/@pmmmwh/react-refresh-webpack-plugin/client/ReactRefreshEntry.js (ReactRefreshEntry.js:17:1)
at Object.options.factory (react refresh:6:1)
at webpack_require (bootstrap:24:1)
at startup:4:1
at startup:7:1
报错原因:
我的 react-devtools 版本可能太低,然后我就换了一个高的版本,就解决了,既解决报错,又能使用 tool
解决方案:
进入 https://www.crx4chrome.com/crx/277332/ 网站,点击下载
然后把它添加到chrome 浏览器的扩展程序中,就可以了