뭔가 갑자기 잘되던 리액트 앱이 먹통이 되면서 아무것도 클릭되지 않는 문제가 발생했다.
console 로그를 살펴보니 아래와 같은 에러가 떠 있는걸 볼 수 있었다.
"Uncaught ReferenceError: process is not defined"
찾아보니 아래와 같은 해결책을 찾을 수 있었다.
https://github.com/facebook/create-react-app/issues/11771
v5 Regression react-error-overlay build - Uncaught ReferenceError: process is not defined · Issue #11771 · facebook/create-rea
I use following command to start: npm run start Then, whenever I save a file, I get the following "Uncaught ReferenceError: process is not defined" error in the browser console. VM27:2 Un...
github.com
원인은 정확히 모르겠지만 react-script 의 버전이 낮아서 발생한 문제 같았다.
[해결방법]
1. package.json 에서 "react-scripts": "4.0.7" 버전을 "react-scripts": "5.0.0" 으로 수정한다.
2. 아래 파일들을 차례로 삭제하고 package 를 인스톨 한다.
> rm -rf package-lock.json
> rm -rf yarn.lock
> yarn install
이렇게 했더니 문제가 해결되었다.