React application failing with Uncaught TypeError: Cannot read property 'forEach' of undefined


+ 4

My react app started failing with error Uncaught TypeError: Cannot read property 'forEach' of undefined and not giving any stacktrace related to my application's code.
I have updated to latest react also tried deleting node_modules folder still the error persists

4 Answers

5 years ago by

0

did you manage to fix the problem?

4 years ago by Vlad T

0

Could you fix this problem?

4 years ago by Varsha Teckchandani

+ 2

I managed to solve, in my case was the index.html file in public that was minified by webpack. After restoring it from a clean index.html file, everything went back to normal.

Consider that in my case, and I don't know why, webpack decided to push a lot of minified JS into the index.html file.

I hope it helps someone, since I could not find any tip in my DuckDuckGo searchs. Had a really bad time with this issue.

4 years ago by Diego Morais

0

thanks diego, your suggestion worked. Don't know why yet.

3 years ago by palash



Your Answer