今天用官方yarn create react-app antd-demo创建新项目的时候出现ReactRefreshEntry.js报错,导致页面一直打不开,错误如下
react-refresh-runtime.development.js:465 Uncaught TypeError: Cannot read property 'forEach' of undefined
at Object.injectIntoGlobalHook (react-refresh-runtime.development.js:465)
at Object../node_modules/react-scripts/node_modules/@pmmmwh/react-refresh-webpack-plugin/client/ReactRefreshEntry.js (ReactRefreshEntry.js:8)
at __webpack_require__ (bootstrap:856)
at fn (bootstrap:150)
at Object.1 (reportWebVitals.js:14)
at __webpack_require__ (bootstrap:856)
at checkDeferredModules (bootstrap:45)
at Array.webpackJsonpCallback [as push] (bootstrap:32)
at main.chunk.js:1
injectIntoGlobalHook @ react-refresh-runtime.development.js:465
./node_modules/react-scripts/node_modules/@pmmmwh/react-refresh-webpack-plugin/client/ReactRefreshEntry.js @ ReactRefreshEntry.js:8
__webpack_require__ @ bootstrap:856
fn @ bootstrap:150
1 @ reportWebVitals.js:14
__webpack_require__ @ bootstrap:856
checkDeferredModules @ bootstrap:45
webpackJsonpCallback @ bootstrap:32
(anonymous) @ main.chunk.js:1
原因是浏览器安装了React Developer Tools
3.6.0 插件,我把它禁用掉以后页面能正常打开。