AWS에서 메모리부족 빌드 안되는 문제>
올려주신 타입스크립트-리액트쿼리 기반으로
연습용 프로젝트 만들어서 AWS에서 npm build를 했는데 에러가 발생하네요.
로컬에선 빌드가 정상적으로 됐습니다.
back은 aws에서 정상적으로 작동하고 front 빌드가 실패하네요.
서버는 강의에 나온 그대로 무료서버 선택했습니다.
AWS 로그는 이러합니다.
> excuse-moa-front-rq@1.0.0 build /home/ubuntu/excuse-moa/front_rq
> cross-env ANALYZE=true NODE_ENV=production next build
info - Using webpack 5. Reason: Enabled by default https://nextjs.org/docs/messages/webpack5
info - Checking validity of types
error - ESLint: Failed to load config "airbnb" to extend from. Referenced from: /home/ubuntu/excuse-moa/front_rq/.eslintrc.js
info - Using external babel configuration from /home/ubuntu/excuse-moa/front_rq/.babelrc
info - Creating an optimized production build .
<--- Last few GCs --->
[11366:0x53d8700] 68649 ms: Mark-sweep (reduce) 485.5 (491.0) -> 484.3 (491.5) MB, 775.4 / 0.0 ms (average mu = 0.186, current mu = 0.085) allocation failure scavenge might not succeed
[11366:0x53d8700] 68736 ms: Scavenge (reduce) 485.4 (490.5) -> 484.5 (491.5) MB, 4.6 / 0.0 ms (average
mu = 0.186, current mu = 0.085) allocation failure
[11366:0x53d8700] 68823 ms: Scavenge (reduce) 485.4 (493.5) -> 484.8 (493.7) MB, 26.9 / 0.0 ms (average mu = 0.186, current mu = 0.085) allocation failure
<--- JS stacktrace --->
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
1: 0xa38a30 node::Abort() [node]
2: 0x96e0af node::FatalError(char const*, char const*) [node]
3: 0xbb7ebe v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [node]
4: 0xbb8237 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [node]
5: 0xd74445 [node]
6: 0xd74fcf [node]
7: 0xd82e0b v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node]
8: 0xd869cc v8::internal::Heap::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [node]
9: 0xd550ab v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationType, v8::internal::AllocationOrigin) [node]
10: 0x109d68f v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*)
[node]
11: 0x14467f9 [node]
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! excuse-moa-front-rq@1.0.0 build: `cross-env ANALYZE=true NODE_ENV=production next build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the excuse-moa-front-rq@1.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2022-01-23T08_23_06_820Z-debug.log
에러 발생후 package-lock.json, node_modules 삭제하고 재시도 했는데 그대로네요.
allocation failure면 메모리부족같긴 한데 원인이
tree-shaking 못한 최적화 문제인지 그저 서버 램부족인지
제가 놓친게 있는건지 궁금합니다.
답변 1
넥스트 버젼 질문
0
90
2
로그인시 401 Unauthorized 오류가 뜹니다
0
104
1
무한 스크롤 중 스크롤 튐 현상
0
192
1
특정 페이지 접근을 막고 싶을 때
0
116
2
createGlobalStyle의 위치와 영향범위
0
102
2
인라인 스타일 리렌더링 관련
0
97
2
vsc 에서 npm init 설치시 오류
0
157
2
nextjs 15버전 사용 가능할까요?
0
166
1
화면 새로고침 문의
0
129
1
RTK에서 draft, state 차이가 있나요?
0
160
2
Next 14 사용해도 될까요?
0
455
1
next, node 버전 / 폴더 구조 질문 드립니다.
0
359
1
url 오류 질문있습니다
0
214
1
ssh xxxxx로 우분투에 들어가려니까 port 22: Connection timed out
0
391
1
sudo certbot --nginx 에러
0
1293
2
Minified React error 콘솔에러 (hydrate)
0
477
1
카카오 공유했을 때 이전에 작성했던 글이 나오는 버그
0
255
1
프론트서버 배포 후 EADDRINUSE에러 발생
0
337
1
npm run build 에러
0
525
1
front 서버 npm run build 중에 발생한 에러들
0
399
1
서버 실행하고 브라우저로 들어갔을때 404에러
0
350
2
css 서버사이드 랜더링이 적용되지 않아서 문의 드립니다.
0
290
1
팔로워 3명씩 불러오고 데이터 합쳐주는걸로 바꾸고 서버요청을 무한으로하고있습니다.
0
249
2
해시태그 검색에서 throttle에 관해 질문있습니다.
0
206
1





