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
+ 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.