네로개발일기

개발자 네로의 개발 일기, 자바를 좋아합니다 !

반응형

💻  OS: macOS m1

✅  node version: 12.22.1

 

오류

mac m1에서 react 프로젝트를 실행시키기 위해 npm start 명령어를 사용

다음과 같은 오류 발생

FATAL ERROR: wasm code commit Allocation failed - process out of memory

 

검색해본 결과 mac m1에서 node version 15를 제외하고 잘 작동하지 않는다고 한다. 14도 되는데 12는 오류가 생기는 것 같다.

 

react-refresh-webpack-plugin과 webpack5 충돌하여 발생하는 것으로 보이고 (사실 필자는 react에 대해 아무것도 모른다...)

development에서 FAST_REFRESH 가 true가 디폴트로 실행된다. 

 

해결

아래 명령어를 사용해 해결하였다.

$ env FAST_REFRESH=false npm start

 

출처

https://github.com/pmmmwh/react-refresh-webpack-plugin/issues/259

 

Apple Silicon / arm64 / M1 compatibility? · Issue #259 · pmmmwh/react-refresh-webpack-plugin

Hi, We're using & loving react-refresh-webpack-plugin - thank you! Recently Apple Silicon came out with arch64-based CPUs. Somehow, this plugin breaks on that architecture with a strange er...

github.com

https://github.com/facebook/create-react-app/issues/10090

 

npm start gives error · Issue #10090 · facebook/create-react-app

Npm start throws error. Project was created with npx create-react-app FATAL ERROR: WasmCodeManager::Commit: Cannot make pre-reserved region writable Allocation failed - process out of memory Error ...

github.com

참고

https://dev-momo.tistory.com/entry/React-Fast-Refresh

 

React Fast Refresh

최근에 React 프로젝트르 세팅하다가 React-Hot-Loader 문서를 보니, React Fast Refresh라는 새로운 도구가 나온 것을 발견했다. React-Hot-Loader를 만든 페이스북 개발자 Dan Abramov는, 기존 핫 로더에 한계가..

dev-momo.tistory.com

 

728x90
반응형
blog image

Written by ner.o

개발자 네로의 개발 일기, 자바를 좋아합니다 !