I created a project using npx create-react-app my-app. If I use npm start, the application does not work. I have not made any changes to the project
The console contains this 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
How i can fix this error?
It appears that this issue has been around for a couple of months now, catching those who are new to Create React App. It's rather unfortunate but depending on your CRA version the solution is to either:
I've documented it here: https://github.com/facebook/create-react-app/issues/10500
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With