NativeScript / nativescript-plugin-seed

Get started building NativeScript plugins quickly.
Apache License 2.0
102 stars 54 forks source link

Publishing plugin leads to JavaScript heap out of memory #57

Closed dartmann closed 6 years ago

dartmann commented 6 years ago

Make sure to check the demo app(s) for sample usage

Not relevant.

Make sure to check the existing issues in this repository

Done.

If the demo apps cannot help and there is no issue for your problem, tell us about it

When I try to publish my plugin, the pack.sh script fails at the step when the newly created src dir is built.

Which platform(s) does your issue occur on?

Please, provide the following version numbers that your issue occurs with:

Please, tell us how to recreate the issue in as much detail as possible.

I configured my project for publishing to the npm repo of my company. Afterwards, I run the publish.sh script and got the following error:

Building /src...

<--- Last few GCs --->

   39933 ms: Mark-sweep 1359.2 (1437.2) -> 1359.0 (1437.2) MB, 1301.8 / 0.0 ms [allocation failure] [GC in old space requested].
   41278 ms: Mark-sweep 1359.0 (1437.2) -> 1359.0 (1437.2) MB, 1345.2 / 0.0 ms [allocation failure] [GC in old space requested].
   42580 ms: Mark-sweep 1359.0 (1437.2) -> 1361.9 (1413.2) MB, 1300.8 / 0.0 ms [last resort gc].
   43873 ms: Mark-sweep 1361.9 (1413.2) -> 1364.7 (1413.2) MB, 1292.5 / 0.0 ms [last resort gc].

<--- JS stacktrace --->

==== JS stack trace =========================================

Security context: 0x14317b2cfb39 <JS Object>
    1: getTypeOfFuncClassEnumModule [/Users/david/Desktop/ecsec/taxi/plugins/nativescript-keystore/publish/src/node_modules/typescript/lib/tsc.js:~24186] [pc=0x3f4d0488399] (this=0x10ad20755ea1 <JS Global Object>,symbol=0x191d40910a59 <a Symbol with map 0x1081ea107641>)
    2: getTypeOfSymbol [/Users/david/Desktop/ecsec/taxi/plugins/nativescript-keystore/publish/src/node_modules/typescript/lib/...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
 1: node::Abort() [/usr/local/bin/node]
 2: node::FatalException(v8::Isolate*, v8::Local<v8::Value>, v8::Local<v8::Message>) [/usr/local/bin/node]
 3: v8::Utils::ReportApiFailure(char const*, char const*) [/usr/local/bin/node]
 4: v8::Utils::ApiCheck(bool, char const*, char const*) [/usr/local/bin/node]
 5: v8::internal::V8::FatalProcessOutOfMemory(char const*, bool) [/usr/local/bin/node]
 6: v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationSpace) [/usr/local/bin/node]
 7: v8::internal::Runtime_AllocateInTargetSpace(int, v8::internal::Object**, v8::internal::Isolate*) [/usr/local/bin/node]
 8: 0x3f4d03079a7
 9: 0x3f4d0488399
10: 0x3f4d04a8cb8
11: 0x3f4d086240e
./pack.sh: line 13: 32492 Abort trap: 6           node_modules/.bin/tsc
Creating package...

Is there any code involved?

At the moment I am not able to provide the code of the project. Hopefully somebody can provide me an advice what the issue could be, anyway.

Update

It seems that this error is rather a problem of the typescript compiler: MS Typescript Issue 1, MS Typescript Issue 2. Should I open an Issue at there repo? I think the main problem in this case would be the reproduction step of the error, because I do not know where exactly the compiler fails...

dartmann commented 6 years ago

The problem magically disappeared after hours of debugging. I hate it, when I can not figure out what exactly the problem was... 😞 Sorry for any inconvenience and kind regards, David.