Olafaloofian / React-Frontend-Lightsail-Deployment

A guided tutorial on how to host a frontend React project using Amazon Lightsail

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Lightsail React JS

harryman1 opened this issue · comments

I have an odd error, but I can't find a solution, and I wonder if you know about this issue

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory

Writing Node.js report to file: report.20190822.143348.18294.0.001.json
Node.js report completed
1: 0x9b07f0 node::Abort() [node]
2: 0x9b1986 node::OnFatalError(char const*, char const*) [node]
3: 0xb0ffde v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [node]
4: 0xb10359 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [node]
5: 0xced265 [node]
6: 0xcf8aab v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [node]
7: 0xcf97c7 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node]
8: 0xcfc2f8 v8::internal::Heap::AllocateRawWithRetryOrFail(int, v8::internal::AllocationType, v8::internal::AllocationAlignment) [node]
9: 0xcc5c07 v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationType) [node]
10: 0xf9c7c8 v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [node]
11: 0x131eb19 [node]
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! client@0.1.0 build: react-scripts build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the client@0.1.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! /home/ubuntu/.npm/_logs/2019-08-22T14_33_49_414Z-debug.log

This must be because the RAM did not manage to build the project, which is why the tutorial explains to create a SWAP memory.

@harryman1 Sorry I'm getting to this so late, but if you're still having this issue (and to anyone else who stumbles across this): @dsmartins98 is right. If you opt for a lower-tiered Lightstail option, you will likely have to create SWAP memory for your project to build successfully.

Another less elegant, but cheaper option is to build locally and just FTP the build folder to your low-tier lightsail machine.