小编Kov*_*der的帖子

无法读取未定义的属性“forEach”(React)


今天我开始学习react!我遇到了困难。

我使用创建了一个项目npx create-react-app my-app。如果我使用npm start,该应用程序将无法运行。我没有对项目进行任何更改

控制台包含此错误:

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/@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
Run Code Online (Sandbox Code Playgroud)

我该如何修复这个错误?

reactjs

3
推荐指数
1
解决办法
3798
查看次数

标签 统计

reactjs ×1