[Solved] React Project Start Error: Uncaught TypeError: Cannot read property ‘forEach‘ of undefined

If your react scaffold runs successfully, the page is white and there are the following errors in the console

Well, this is because your browser has installed the react devtools extension. Many people’s way is to disable react devtools directly. I suggest you not. After all, this plug-in is still very useful, and it’s really troublesome to install

Solution:

1. Change other browsers to preview [with Firefox]

2. Change code

Found in your project   node_ Modules/@ pmmmwh/react refresh webpack plugin

Comment out this line of code and restart the project!

At this time, the project can run normally and your plug-in can also be used

However, this method is cumbersome. It needs to be changed every time the scaffold is created, but this problem only exists in the new version of react. It seems that this problem does not exist in the old version

Similar Posts: