process is not defined on hot reload

Upgrading your application to CRA (react-scripts) v5 with npm i react-scripts@latest will fix the issue.

If your app is not able to be upgraded because dependencies are incompatible or you require node version < 14, you can try the following workaround which worked for me:

  1. Revert back to CRA 4: npm i --save-exact react-scripts@4.0.3
  2. Add react-error-overlay as a dev dependency: npm i --save-dev react-error-overlay@6.0.9
  3. Then add the following line to your package.json
"resolutions": {
  "react-error-overlay": "6.0.9"
},
  1. If you’re using NPM, force your package-lock.json file to actually use 6.0.9 with npx npm-force-resolutions

    If you’re using Yarn, just run yarn install and your resolutions will be applied and fix the issue

More info at https://github.com/facebook/create-react-app/issues/11773

Leave a Comment