ember-cli / ember-cli-babili

BSD 2-Clause "Simplified" License
4 stars 5 forks source link

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed error on build #9

Closed frsechet closed 7 years ago

frsechet commented 7 years ago

Hello,

I suddenly had errors (with no specific code change, so I'm guessing a module update broke my build) when using uglify-js, so I switched to babili.

The following happens after several minutes of ember build -e production:

<--- Last few GCs --->

  461977 ms: Mark-sweep 1313.6 (1434.3) -> 1312.6 (1434.3) MB, 2035.3 / 0.0 ms [allocation failure] [GC in old space requested].
  464264 ms: Mark-sweep 1312.6 (1434.3) -> 1312.6 (1434.3) MB, 2287.4 / 0.0 ms [allocation failure] [GC in old space requested].
  466679 ms: Mark-sweep 1312.6 (1434.3) -> 1317.5 (1405.3) MB, 2413.9 / 0.0 ms [last resort gc].
  468892 ms: Mark-sweep 1317.5 (1405.3) -> 1322.4 (1405.3) MB, 2212.5 / 0.0 ms [last resort gc].

<--- JS stacktrace --->

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

Security context: 0x207cde4cfb39 <JS Object>
    2: evaluate(aka evaluate) [/Users/frsechet/spoc/app/node_modules/babel-traverse/lib/path/evaluation.js:62] [pc=0x29f6f20d4cea] (this=0x207cde404381 <undefined>,path=0x2f5b7d4dfe59 <a NodePath with map 0x2aebbb148301>)
    3: evaluate [/Users/frsechet/spoc/app/node_modules/babel-traverse/lib/path/evaluation.js:~30] [pc=0x29f6f1f89eee] (this=0x2f5b7d4dfe59 <a NodePath with map 0x2aebbb148301>...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
 1: node::Abort() [/Users/frsechet/.nvm/versions/node/v6.10.2/bin/node]
 2: node::FatalException(v8::Isolate*, v8::Local<v8::Value>, v8::Local<v8::Message>) [/Users/frsechet/.nvm/versions/node/v6.10.2/bin/node]
 3: v8::internal::V8::FatalProcessOutOfMemory(char const*, bool) [/Users/frsechet/.nvm/versions/node/v6.10.2/bin/node]
 4: v8::internal::Factory::NewTransitionArray(int) [/Users/frsechet/.nvm/versions/node/v6.10.2/bin/node]
 5: v8::internal::TransitionArray::Insert(v8::internal::Handle<v8::internal::Map>, v8::internal::Handle<v8::internal::Name>, v8::internal::Handle<v8::internal::Map>, v8::internal::SimpleTransitionFlag) [/Users/frsechet/.nvm/versions/node/v6.10.2/bin/node]
 6: v8::internal::Map::CopyReplaceDescriptors(v8::internal::Handle<v8::internal::Map>, v8::internal::Handle<v8::internal::DescriptorArray>, v8::internal::Handle<v8::internal::LayoutDescriptor>, v8::internal::TransitionFlag, v8::internal::MaybeHandle<v8::internal::Name>, char const*, v8::internal::SimpleTransitionFlag) [/Users/frsechet/.nvm/versions/node/v6.10.2/bin/node]
 7: v8::internal::Map::CopyAddDescriptor(v8::internal::Handle<v8::internal::Map>, v8::internal::Descriptor*, v8::internal::TransitionFlag) [/Users/frsechet/.nvm/versions/node/v6.10.2/bin/node]
 8: v8::internal::Map::CopyWithField(v8::internal::Handle<v8::internal::Map>, v8::internal::Handle<v8::internal::Name>, v8::internal::Handle<v8::internal::FieldType>, v8::internal::PropertyAttributes, v8::internal::Representation, v8::internal::TransitionFlag) [/Users/frsechet/.nvm/versions/node/v6.10.2/bin/node]
 9: v8::internal::Map::TransitionToDataProperty(v8::internal::Handle<v8::internal::Map>, v8::internal::Handle<v8::internal::Name>, v8::internal::Handle<v8::internal::Object>, v8::internal::PropertyAttributes, v8::internal::Object::StoreFromKeyed) [/Users/frsechet/.nvm/versions/node/v6.10.2/bin/node]
10: v8::internal::LookupIterator::PrepareTransitionToDataProperty(v8::internal::Handle<v8::internal::JSObject>, v8::internal::Handle<v8::internal::Object>, v8::internal::PropertyAttributes, v8::internal::Object::StoreFromKeyed) [/Users/frsechet/.nvm/versions/node/v6.10.2/bin/node]
11: v8::internal::Object::AddDataProperty(v8::internal::LookupIterator*, v8::internal::Handle<v8::internal::Object>, v8::internal::PropertyAttributes, v8::internal::Object::ShouldThrow, v8::internal::Object::StoreFromKeyed) [/Users/frsechet/.nvm/versions/node/v6.10.2/bin/node]
12: v8::internal::JSObject::DefineOwnPropertyIgnoreAttributes(v8::internal::LookupIterator*, v8::internal::Handle<v8::internal::Object>, v8::internal::PropertyAttributes, v8::internal::Object::ShouldThrow, v8::internal::JSObject::AccessorInfoHandling) [/Users/frsechet/.nvm/versions/node/v6.10.2/bin/node]
13: v8::internal::JSObject::SetOwnPropertyIgnoreAttributes(v8::internal::Handle<v8::internal::JSObject>, v8::internal::Handle<v8::internal::Name>, v8::internal::Handle<v8::internal::Object>, v8::internal::PropertyAttributes) [/Users/frsechet/.nvm/versions/node/v6.10.2/bin/node]
14: v8::internal::CreateObjectLiteralBoilerplate(v8::internal::Isolate*, v8::internal::Handle<v8::internal::LiteralsArray>, v8::internal::Handle<v8::internal::FixedArray>, bool) [/Users/frsechet/.nvm/versions/node/v6.10.2/bin/node]
15: v8::internal::Runtime_CreateObjectLiteral(int, v8::internal::Object**, v8::internal::Isolate*) [/Users/frsechet/.nvm/versions/node/v6.10.2/bin/node]
16: 0x29f6edd079a7
17: 0x29f6edd2e9c5
18: 0x29f6f20d4cea
19: 0x29f6f1f89eee
20: 0x29f6f20d48f4
21: 0x29f6f218d5d6
[1]    82806 abort      ember build production
stefanpenner commented 7 years ago

I believe this error is upstream. in babel or babili itself. We merely invoke those libs. You may want to also open issues there and cross link.

rwjblue commented 7 years ago

Can you test with the latest version? Many bugs have been fixed in 0.2.0's underlying babili version...

stefanpenner commented 7 years ago

I'm going to clsoe this, as I don't believe this to be a bug here. If anything it should be opened in babili repo.

frsechet commented 7 years ago

Hi @rwjblue thanks I'll have a go with the latest version next week. Maybe it has to do with babili, maybe not, it's hard to say, the error is a bit difficult to read...

Kerrick commented 7 years ago

FWIW, I was having the same issue on our application, and I set babiliOptions to have mangle: false as suggested here, but I seem to be unable to actually disable the mangle plugin. The docs for this don't clearly cover how to format the babili options.

offirgolan commented 7 years ago

@rwjblue @stefanpenner having similar issues on my end as well. Should this be escalated?

thewalkingtoast commented 7 years ago

This just bit our team as we upgraded to 2.13 and started taking advantage of the new targets feature. We've switched to ember-cli-uglify 2.0.0-beta1 no problem. Definitely an upstream issue.