Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Out of memory exception on localized build due to web-animations-js #19660

Closed
tsvetomir opened this issue Dec 21, 2020 · 3 comments · Fixed by #19709
Closed

Out of memory exception on localized build due to web-animations-js #19660

tsvetomir opened this issue Dec 21, 2020 · 3 comments · Fixed by #19709

Comments

@tsvetomir
Copy link

🐞 bug report

Affected Package

The issue is caused by package @angular/compiler-cli (maybe?)

Is this a regression?

Yes, the previous version in which this bug was not present was: 9.x

Description

Localized build fails when importing web-animations-js polyfill.

🔬 Minimal Reproduction

  1. Clone https://github.com/tsvetomir/angular-localize-bug-oom
  2. Run npm install
  3. Run ng serve --configuration=de
  • Commenting the web-animations-js import in src/polyfills.ts resolves the issue.
  • Serving the application with ng serve --configuration=de --source-map=false resolves the issue.

🔥 Exception or Error


> ng serve --configuration=de

⠇ Generating browser application bundles (phase: building)...
<--- Last few GCs --->

[52153:0x102803000]    31680 ms: Scavenge 1373.8 (1422.6) -> 1373.1 (1423.1) MB, 1.8 / 0.0 ms  (average mu = 0.281, current mu = 0.236) allocation failure 
[52153:0x102803000]    31685 ms: Scavenge 1374.0 (1423.1) -> 1373.4 (1424.1) MB, 3.9 / 0.0 ms  (average mu = 0.281, current mu = 0.236) allocation failure 
[52153:0x102803000]    31688 ms: Scavenge 1374.9 (1424.1) -> 1374.4 (1424.6) MB, 2.0 / 0.0 ms  (average mu = 0.281, current mu = 0.236) allocation failure 


<--- JS stacktrace --->

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

    0: ExitFrame [pc: 0xea07ccdbe3d]
Security context: 0x0715f149e6e9 
    1: SourceMapConsumer_allGeneratedPositionsFor [0x71592abfe49] [/Users/[redacted]/test-messages-v2/node_modules/source-map/lib/source-map-consumer.js:~178] [pc=0xea07deb1f5c](this=0x07152c7f6e89 ,aArgs=0x0715b839c501 )
    2: /* anonymous */(aka /* anonymous */) [0x7152ff9ff99] [/U...

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
 1: 0x10003d051 node::Abort() [/usr/local/bin/node]
 2: 0x10003d25b node::OnFatalError(char const*, char const*) [/usr/local/bin/node]
 3: 0x1001b90e5 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/usr/local/bin/node]
 4: 0x100587042 v8::internal::Heap::FatalProcessOutOfMemory(char const*) [/usr/local/bin/node]
 5: 0x100589b15 v8::internal::Heap::CheckIneffectiveMarkCompact(unsigned long, double) [/usr/local/bin/node]
 6: 0x1005859bf v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [/usr/local/bin/node]
 7: 0x100583b94 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/usr/local/bin/node]
 8: 0x10059042c v8::internal::Heap::AllocateRawWithLigthRetry(int, v8::internal::AllocationSpace, v8::internal::AllocationAlignment) [/usr/local/bin/node]
 9: 0x1005904af v8::internal::Heap::AllocateRawWithRetryOrFail(int, v8::internal::AllocationSpace, v8::internal::AllocationAlignment) [/usr/local/bin/node]
10: 0x10055fdf4 v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationSpace) [/usr/local/bin/node]
11: 0x1007e80d4 v8::internal::Runtime_AllocateInNewSpace(int, v8::internal::Object**, v8::internal::Isolate*) [/usr/local/bin/node]
12: 0xea07ccdbe3d 
[1]    52152 abort      npm start

🌍 Your Environment

Angular Version:



     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/
    

Angular CLI: 11.0.5
Node: 10.19.0
OS: darwin x64

Angular: 11.0.5
... animations, cli, common, compiler, compiler-cli, core, forms
... localize, platform-browser, platform-browser-dynamic, router
Ivy Workspace: Yes

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1100.5
@angular-devkit/build-angular   0.1100.5
@angular-devkit/core            11.0.5
@angular-devkit/schematics      11.0.5
@schematics/angular             11.0.5
@schematics/update              0.1100.5
rxjs                            6.6.3
typescript                      4.0.5

@josephperrott josephperrott transferred this issue from angular/angular Dec 21, 2020
@tsvetomir
Copy link
Author

Including the script in angular.json through architect.build.options can also be used as a workaround:

"scripts": [
  "node_modules/web-animations-js/web-animations.min.js"
]

@alan-agius4
Copy link
Collaborator

alan-agius4 commented Jan 4, 2021

Also related to #18398

@ngbot ngbot bot added this to the Backlog milestone Jan 4, 2021
filipesilva pushed a commit that referenced this issue Jan 5, 2021
This library is minified and it causes Babel to consume a lot of resources when trying to downlevel.

Closes #19660
filipesilva pushed a commit that referenced this issue Jan 5, 2021
This library is minified and it causes Babel to consume a lot of resources when trying to downlevel.

Closes #19660

(cherry picked from commit cfb3684)
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Feb 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants