0

After I have deployed my angular 7 app and trying to open it on browser, I get Error 500. Checking log I find this:

A  FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory 
A   1: node::Abort() [node] 
A   2: 0x74f83c6b2ae [node] 
A   3: v8::Utils::ReportOOMFailure(char const*, bool) [node] 
A   4: v8::internal::V8::FatalProcessOutOfMemory(char const*, bool) [node] 
A   5: v8::internal::Factory::NewRawTwoByteString(int, v8::internal::PretenureFlag) [node] 
A   6: v8::internal::String::SlowFlatten(v8::internal::Handle<v8::internal::ConsString>, v8::internal::PretenureFlag) [node] 
A   7: v8::internal::parsing::ParseProgram(v8::internal::ParseInfo*, v8::internal::Isolate*) [node] 
A   8: 0x74f8416f63b [node] 
A   9: v8::internal::Compiler::GetSharedFunctionInfoForScript(v8::internal::Handle<v8::internal::String>, v8::internal::Handle<v8::internal::Object>, int, int, v8::ScriptOriginOptions, v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Context>, v8::Extension*, v8::internal::ScriptData**, v8::ScriptCompiler::CompileOptions, v8::internal::NativesFlag) [node] 
A  10: v8::ScriptCompiler::CompileUnboundInternal(v8::Isolate*, v8::ScriptCompiler::Source*, v8::ScriptCompiler::CompileOptions) [node] 
A  11: 0x74f83c9a9fb [node] 
A  12: v8::internal::FunctionCallbackArguments::Call(void (*)(v8::FunctionCallbackInfo<v8::Value> const&)) [node] 
A  13: v8::internal::Builtin_HandleApiCall(int, v8::internal::Object**, v8::internal::Isolate*) [node] 
A  14: 0x2ef87fd042fd 
A  Aborted 

Thing is, if you google FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory the fix should be changing package.json start line to this "start": "node --max_old_space_size=4096 dist/server",. With this the error from log goes away, but page still gives error 500 and now logs shows only this:

F  GET 500 0 B 3.3 s Chrome 70 / GET 500 0 B 3.3 s Chrome 70 5cb9a64b00ff0dd3429e5e7b0e0001657e6e6f6c696665000166726f6e74656e643a323031393034313974313333353337000100
A  Node Express server listening on http://localhost:8080 

Maybe I need to write something more into app.yaml file or change it, right now it looks like this:

runtime: nodejs8
env: standard
service: frontend

My angular app is also server side rendered and doesn't use firebase.

user1203497
  • 507
  • 3
  • 11
  • 18

1 Answers1

0

I got it working. Problems seems to be in app.yaml file. I had to set instance_class to F2. If you don't set you are default F1 and memory in that class was too low. Now my app.yaml file looks like this:

runtime: nodejs8
env: standard
service: frontend
instance_class: F2
user1203497
  • 507
  • 3
  • 11
  • 18