question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot read property 'forEach' of undefined

See original GitHub issue

Hello 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: 2020-12-12 (2)

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:1
  • Comments:10

github_iconTop GitHub Comments

7reactions
avihaymenahemcommented, Dec 15, 2020

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())

3reactions
blockmoodcommented, Dec 21, 2020

@KovbenyaAlexander Close the Browser react plugin。

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found