Cannot read property 'forEach' of undefined
See original GitHub issueHello
I created a project using npx create-react-app my-app
. If i use npm start
, compilation is successful, but the page is blank.
I have not made any changes to the project.
The console contains an error:
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
Screenshot:
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:10
Top Results From Across the Web
Cannot read property 'forEach' of undefined - Stack Overflow
And undefined has no forEach method. To fix this, always make sure you put a semicolon at the end of your lines (or...
Read more >TypeError: Cannot read property 'forEach' of Undefined in JS
The "Cannot read property 'forEach' of undefined" error occurs when the forEach() method is called on an undefined value. To solve the error,...
Read more >[AskJS] Why does this simple forEach give error Cannot read ...
But the following code gives an error script.js?v=3:196 Uncaught TypeError: Cannot read property 'forEach' of undefined :
Read more >typeerror: cannot read properties of undefined (reading 'foreach')
Your problem is that you are trying to loop though the data object which is not a array. You can only use the...
Read more >cannot read property 'foreach' of undefined javascript, typeerror
cannot read property 'foreach' of undefined javascript ... And undefined has no forEach method. To fix this, always make sure you put a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Same here, running from npx here causes the same issue (no modifications maded)
EDIT: A workaround for now so you can keep on working: Disable the React DEV TOOLS extension on Chrome.
The problem comes from the global Hook which initiated wrong (Missing renderers prop on the object, which needs to be initiated with new Map())
@KovbenyaAlexander Close the Browser react plugin。