angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

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

Open arayik-yervandyan opened this issue 7 years ago β€’ 205 comments

🐞 Bug report

Command (mark with an x)

- [ ] new
- [X] build
- [ ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Description

With the last merge project build process is not working. I get failure that is pasted below. Tried to change --max-old-space-size=4096 still not working. Any suggestions what this can be ?

πŸ”¬ Minimal Reproduction

run command ng build --prod in angular.json file we have

"production": {
	"optimization": true,
	"outputHashing": "all",
	"sourceMap": false,
	"extractCss": true,
	"namedChunks": false,
	"aot": true,
	"extractLicenses": true,
	"vendorChunk": false,
	"buildOptimizer": true,
	"fileReplacements": [
	{
		"replace": "src/environments/environment.ts",
		"with": "src/environments/environment.prod.ts"
	}
	]
},

πŸ”₯ Exception or Error

Here is the log file.

{ Error: Command failed: ng build --prod --configuration=config --output-path=test --base-href=/test/
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
 1: 0x8dbaa0 node::Abort() [ng build --prod --configuration=config --output-path=test --base-href=/test/]
 2: 0x8dbaec  [ng build --prod --configuration=config --output-path=test --base-href=/test/]
 3: 0xad83de v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [ng build --prod --configuration=config --output-path=test --base-href=/test/]
 4: 0xad8614 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [ng build --prod --configuration=config --output-path=test --base-href=/test/]
 5: 0xec5c42  [ng build --prod --configuration=config --output-path=test --base-href=/test/]
 6: 0xec5d48 v8::internal::Heap::CheckIneffectiveMarkCompact(unsigned long, double) [ng build --prod --configuration=config --output-path=test --base-href=/test/]
 7: 0xed1e22 v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [ng build --prod --configuration=config --output-path=test --base-href=/test/]
 8: 0xed2754 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [ng build --prod --configuration=config --output-path=test --base-href=/test/]
 9: 0xed53c1 v8::internal::Heap::AllocateRawWithRetryOrFail(int, v8::internal::AllocationSpace, v8::internal::AllocationAlignment) [ng build --prod --configuration=config --output-path=test --base-href=/test/]
10: 0xe9d636  [ng build --prod --configuration=config --output-path=test --base-href=/test/]
11: 0xeafee7 v8::internal::Factory::NewLoadHandler(int) [ng build --prod --configuration=config --output-path=test --base-href=/test/]
12: 0xf2f4db v8::internal::LoadHandler::LoadFromPrototype(v8::internal::Isolate*, v8::internal::Handle<v8::internal::Map>, v8::internal::Handle<v8::internal::JSReceiver>, v8::internal::Handle<v8::internal::Smi>, v8::internal::MaybeHandle<v8::internal::Object>, v8::internal::MaybeHandle<v8::internal::Object>) [ng build --prod --configuration=config --output-path=test --base-href=/test/]
13: 0xf36d1f v8::internal::LoadIC::ComputeHandler(v8::internal::LookupIterator*) [ng build --prod --configuration=config --output-path=test --base-href=/test/]
14: 0xf3d94c v8::internal::LoadIC::UpdateCaches(v8::internal::LookupIterator*) [ng build --prod --configuration=config --output-path=test --base-href=/test/]
15: 0xf3dffc v8::internal::LoadIC::Load(v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Name>) [ng build --prod --configuration=config --output-path=test --base-href=/test/]
16: 0xf42935 v8::internal::Runtime_LoadIC_Miss(int, v8::internal::Object**, v8::internal::Isolate*) [ng build --prod --configuration=config --output-path=test --base-href=/test/]
17: 0x235e3925be1d

🌍 Your Environment


Angular CLI: 7.3.1
Node: 10.15.1
OS: linux x64
Angular: 7.2.6
... animations, common, compiler, compiler-cli, core, forms
... http, platform-browser, platform-browser-dynamic, router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.13.2
@angular-devkit/build-angular     0.13.2
@angular-devkit/build-optimizer   0.13.2
@angular-devkit/build-webpack     0.13.2
@angular-devkit/core              7.3.2
@angular-devkit/schematics        7.3.1
@angular/cdk                      7.3.3
@angular/cli                      7.3.1
@ngtools/webpack                  7.3.2
@schematics/angular               7.3.1
@schematics/update                0.13.1
rxjs                              6.4.0
typescript                        3.1.6
webpack                           4.29.0

arayik-yervandyan avatar Feb 21 '19 13:02 arayik-yervandyan

@jsgoupil got in touch and let me have a look at his project. I turned off the terser cache (described in https://github.com/angular/angular-cli/issues/13734#issuecomment-508815407) and benchmarked the "ng build 3cconnect --prod" command:

[benchmark] Benchmarking process over 5 iterations, with up to 5 retries.
[benchmark]   ng build 3cconnect --prod (at D:\sandbox\memory-debug\jsgoupil)
[benchmark] Process Stats
[benchmark]   Elapsed Time: 258795.40 ms (280888.00, 250100.00, 241312.00, 256762.00, 264915.00)
[benchmark]   Average Process usage: 3.40 process(es) (3.41, 3.39, 3.42, 3.41, 3.39)
[benchmark]   Peak Process usage: 8.00 process(es) (8.00, 8.00, 8.00, 8.00, 8.00)
[benchmark]   Average CPU usage: 11.59 % (13.45, 10.73, 10.52, 11.53, 11.75)
[benchmark]   Peak CPU usage: 236.56 % (237.60, 325.10, 168.60, 207.80, 243.70)
[benchmark]   Average Memory usage: 1523.76 MB (1547.40, 1471.40, 1544.40, 1562.83, 1492.76)
[benchmark]   Peak Memory usage: 2898.84 MB (2940.99, 2707.18, 2969.51, 3049.01, 2827.53)

This build has AOT and Build Optimizer turned off, and is using Differential Loading. The average memory usage is right at the maximum as well, which means the garbage collector is doing a lot of work to free up memory as the build progresses.

Tried turning on AOT and Build Optimizer and got OOM on the second DL build, during TerserPlugin. Used the node --max_old_space_size=8000 ./node_modules/@angular/cli/bin/ng build 3cconnect --prod --aot --build-optimizer command to build and it succeeded.

Benchmark for this build shows the following numbers:

$ benchmark -- node --max_old_space_size=8000 ./node_modules/@angular/cli/bin/ng build 3cconnect --prod --aot --build-optimizer
[benchmark] Benchmarking process over 5 iterations, with up to 5 retries.
[benchmark]   node --max_old_space_size=8000 ./node_modules/@angular/cli/bin/ng build 3cconnect --prod --aot --build-optimizer (at D:\sandbox\memory-debug\jsgoupil)
[benchmark] Process Stats
[benchmark]   Elapsed Time: 571885.00 ms (567385.00, 558561.00, 574671.00, 572119.00, 586689.00)
[benchmark]   Average Process usage: 2.93 process(es) (2.84, 2.90, 3.02, 2.89, 3.02)
[benchmark]   Peak Process usage: 8.40 process(es) (8.00, 8.00, 9.00, 8.00, 9.00)
[benchmark]   Average CPU usage: 11.00 % (10.82, 11.15, 11.26, 10.87, 10.89)
[benchmark]   Peak CPU usage: 333.82 % (381.40, 243.80, 272.00, 342.10, 429.80)
[benchmark]   Average Memory usage: 2997.71 MB (3094.71, 2923.23, 2899.82, 2987.55, 3083.24)
[benchmark]   Peak Memory usage: 5613.08 MB (5643.63, 5567.17, 5615.44, 5592.79, 5646.38)

I also tried without Build Optimizer turned on:

[benchmark] Benchmarking process over 5 iterations, with up to 5 retries.
[benchmark]   node --max_old_space_size=8000 ./node_modules/@angular/cli/bin/ng build 3cconnect --prod --aot (at D:\sandbox\memory-debug\jsgoupil)
[benchmark] Process Stats
[benchmark]   Elapsed Time: 395413.60 ms (396473.00, 384629.00, 401091.00, 396822.00, 398053.00)
[benchmark]   Average Process usage: 2.56 process(es) (2.61, 2.53, 2.53, 2.52, 2.62)
[benchmark]   Peak Process usage: 8.00 process(es) (8.00, 8.00, 8.00, 8.00, 8.00)
[benchmark]   Average CPU usage: 10.42 % (10.50, 9.93, 10.76, 10.58, 10.32)
[benchmark]   Peak CPU usage: 297.14 % (307.80, 251.40, 293.70, 376.60, 256.20)
[benchmark]   Average Memory usage: 2483.32 MB (2481.63, 2471.55, 2518.96, 2451.15, 2493.35)
[benchmark]   Peak Memory usage: 5238.84 MB (5221.19, 5212.36, 5368.60, 5184.88, 5207.16)

I wasn't expecting Build Optimizer to impact either average or peak memory usage that much really. 500mb is a fair bit. We were already looking at a way to reduce the number of processed files in https://github.com/angular/angular-cli/pull/14998, which would help reduce the impact.

These numbers look much higher than the initial ones, but bear in mind that we increased the memory from the 1.4gb default to around 8gb. This means that there isn't as much pressure for the the garbage collector to free up memory, so things stay in memory for longer. For comparison, here is the initial build (without AOT or Build Optimizer) with an increased memory limit:

$ benchmark -- node --max_old_space_size=8000 ./node_modules/@angular/cli/bin/ng build 3cconnect --prod
[benchmark] Benchmarking process over 5 iterations, with up to 5 retries.
[benchmark]   node --max_old_space_size=8000 ./node_modules/@angular/cli/bin/ng build 3cconnect --prod (at D:\sandbox\memory-debug\jsgoupil) 
[benchmark] Process Stats
[benchmark]   Elapsed Time: 253524.00 ms (256206.00, 245034.00, 245636.00, 243953.00, 276791.00)
[benchmark]   Average Process usage: 3.44 process(es) (3.41, 3.45, 3.45, 3.46, 3.42)
[benchmark]   Peak Process usage: 8.00 process(es) (8.00, 8.00, 8.00, 8.00, 8.00)
[benchmark]   Average CPU usage: 11.65 % (12.18, 10.84, 11.67, 11.01, 12.55)
[benchmark]   Peak CPU usage: 200.90 % (200.00, 168.70, 231.20, 217.10, 187.50)
[benchmark]   Average Memory usage: 1972.97 MB (2010.47, 1927.40, 2014.74, 1939.05, 1973.17)
[benchmark]   Peak Memory usage: 3871.67 MB (3942.59, 3815.74, 3944.29, 3851.58, 3804.13)

So when using the same high memory limit, adding turning on AOT and Build Optimizer increased the average memory usage by 1GB and peak memory usage by 1.8GB.

Using just AOT increased build time by 70% (250->400 s), average memory usage by 25% (2000->2500), and peak memory usage by 36% (3800->5200 mb). Adding BO increased build time by 42% (400->570 s), average memory usage by 20% (2500->3000), and peak memory usage by 7% (5200->5600 mb).

I also tried to turn off Differential Loading by setting "target": "es5", in ./tsconfig.json while keeping AOT and Build Optimizer:

[benchmark] Benchmarking process over 5 iterations, with up to 5 retries.
[benchmark]   node --max_old_space_size=8000 ./node_modules/@angular/cli/bin/ng build 3cconnect --prod --aot --build-optimizer (at D:\sandbox\memory-debug\jsgoupil)
[benchmark] Process Stats
[benchmark]   Elapsed Time: 332036.80 ms (291110.00, 303767.00, 297923.00, 395777.00, 371607.00)
[benchmark]   Average Process usage: 2.87 process(es) (2.89, 2.86, 2.87, 2.86, 2.85)
[benchmark]   Peak Process usage: 8.00 process(es) (8.00, 8.00, 8.00, 8.00, 8.00)
[benchmark]   Average CPU usage: 12.42 % (10.63, 11.52, 11.41, 14.30, 14.21)
[benchmark]   Peak CPU usage: 283.98 % (250.00, 237.40, 414.00, 207.70, 310.80)
[benchmark]   Average Memory usage: 2496.03 MB (2555.55, 2533.63, 2524.99, 2409.38, 2456.62)
[benchmark]   Peak Memory usage: 5084.00 MB (5386.41, 5283.17, 5257.22, 4586.35, 4906.83)

Without DL, memory used goes does by ~500mb, similar to https://github.com/angular/angular-cli/issues/13734#issuecomment-508815407. We're looking at improving that.

I tried to figure out how big the project was by listing files in src/ by extension:

$ find -type f | sed -e 's/.*\.//' | sort | uniq -c
      3 eot
      7 gif  
    478 html 
      1 ico  
      2 jpg  
      4 json 
     51 png  
      1 ps1  
    273 scss 
    470 svg  
   1302 ts   
      1 txt  
      3 woff 
      9 woff2
      1 xml  

This does not include third party libs so it doesn't give us much insight as to the total compilation size. But I'm not surprised that this project needs the memory limit increased, there's a lot of TS files in here. I had a look at

@jsgoupil in https://github.com/angular/angular-cli/issues/13734#issuecomment-497365534 you mentioned that an Azure machine with 7gb couldn't build the app, which I find weird because 5.6gb was the maximum I saw on my Windows machine.

Maybe the CI machine is already using 1.4gb? That would make sense. You can probably check how much memory the machine has before the build. But you also said the machine has only 7GB and you are using --max_old_space_size=8192. I'm not really sure how Node behaves when you say it should use more memory than is actually available. So I wonder if that's a problem: you give it a bigger limit than available, so it thinks it can allocate all this memory, but when it's needed the system doesn't have it so you get an error. You do say in https://github.com/angular/angular-cli/issues/13734#issuecomment-497426391 that the error is different with and without the flag so that does point to a different issue. Maybe check how much memory is free and set a limit below that, like 5000 or 6000.

Regardless of the Azure machine you mentioned, it is impressive (in a negative way) that AOT compilation increases memory usage by 1GB average / 1.8GB peak. This is something that we are looking at in the general case. I think in your project it really is just a function of the amount of TS source files that need AOT compilation, I tried taking a profile of the memory usage and it mostly looked like the others I've looked at before from other projects.

I also noticed that you have some weird imports to ../../../node_modules/@angular/core instead of just @angular/core, and similar to RxJs. I think this makes no difference because resolution will still use the package.json there. But I thought it was odd.

filipesilva avatar Jul 08 '19 20:07 filipesilva

If your application crash while building scss files try installing those dependencies node-sass, style-loader and sass-loader, this worked for me!

anyderre avatar Jul 10 '19 18:07 anyderre

Don't know if this is interesting information or not, but I had a lot of issues with versions of @angular-devkit/build-angular newer than 0.800.2 for the travis build recently producing the same error as above. Reverting back to 0.800.2 fixed the issue.

https://travis-ci.org/johannesjo/super-productivity/builds

johannesjo avatar Jul 11 '19 15:07 johannesjo

same issue on ubuntu server 18.04, but this solved my problem: node --max_old_space_size=8192 node_modules/@angular/cli/bin/ng build --prod

Just dropping this in here but if anyone is using AWS codebuild make sure to update your build environment to be configured with more than the minimum 3GB memory, I followed the steps above but had to re-configure my environment with more memory.

In my case, reconfiguring the CodeBuild environment to use more than 3GB(i choose 15GB) was enough to remove the issue...i did not need to change memory settings in node...

ThomasEg avatar Jul 15 '19 18:07 ThomasEg

@ThomasEg , what environment do you have so you did not need to change memory settings in node?

Mine is Windows 10 with 16 GB memory, and changing the node max_old_space_size settings solve the problem: node --max_old_space_size=8192 "node_modules/@angular/cli/bin/ng" build --configuration=production

while node actually used 2 GB memory.

I would suspect that your CodeBuild environment actually give node max_old_space_size behind the sense, while ng build apparently does not read max_old_space_size for node. Can you confirm that?

zijianhuang avatar Jul 15 '19 22:07 zijianhuang

@JohannesHoppe I'm not sure what branch/builds I should be looking at there. Can you link me specific builds where you noticed a difference? This might be related to your caching setup too. When you update Angular CLI you'll likely remove the minification cache that builds leave behind inside node_modules. So the first build without that cache needs more memory.

filipesilva avatar Jul 16 '19 09:07 filipesilva

I've been trying to figure out if there's really a memory leak in Differential Loading (DL) builds. Below are my notes.

TLDR is that there doesn't seem to be any memory leak in DL, but when --max_old_space_size is used V8 will keep memory around. A build can finish successfully with --max_old_space_size=300 without erroring but will use up to 2500mb of memory if given --max_old_space_size=10000.


Trying to figure out if DL really stacks memory endlessly. Modified a DL build to double the entries in webpack-browser-config.js. Normal (2) builds uses 480 average/960 peak, 4 builds is 810/1700, 8 builds is 1400/2500. So each build leaves increases average by 200ish.

I don't quite get why peak also increases so much though. Peak should be average+something... right? Actually that's wrong. Because we already know the usage is going up over time. So the average during the first build is much smaller than the average during the last build. Kinda like an integral. So the number I should care about really is peak, because it represents things better for the multi-build case.

Also noticed that process.memoryUsage().heapUsed gave me numbers were much lower than what I saw on task manager. I found that odd. I also didn't disable the terser cache. I should do that to see if there's also a scaling cost there, after figuring out this initial scaling cost.

Tried doing global.gc every 30 seconds to figure out if memory was truly retained or if node was just very comfortable with the 10gb limit. Did it over 5 iterations. Without GC I got 1200/2150, with GC I got 1200/2050. So only a slightly smaller peak. This shows the memory can't be freed.

Took heap profiles and heap snapshots every 30s. Also tried the memory leak profile on chrome devtools. The heap profiles show almost no change between them. Very odd. Maybe I need to restart the profiler between samples? The snapshots fail to load too, with an error while building retainers. Will re-make them.

Tried profiling again with a lower sampling interval and didn't see anything different. All snapshots but the first still failed with the same message. Also tried just taking one snapshot at the end and got only a small snapshot (200mb).

Tried taking a snapshot manually in Chrome Devtools during the 8th (and last) build. Devtools said the process was using ~2000mb memory just before I took the snapshot, and then it showed only ~260mb. The snapshot was only 254mb.

So I thought it might be a GC thing. Tried limiting max_old_space_size to 1gb and it still built. Also built with 600mb and 400mb, but failed with 300 and 200. A single build run failed with 200 but succeeded with 300. A default DL build failed with 300 too.

So as far as I can tell there isn't any real amount of memory being kept because of DL. Maybe there's to 100 extra mb. A new app will use roughly the same memory (~300mb on the main process, plus up to 450mb on spawned Terser processes) for producing 1 build or 8 builds in the same command. But if I set the memory limit to a a very large number (10gb) then it will keep more memory around (up to 2.5gb) until it needs to be freed.

filipesilva avatar Jul 16 '19 10:07 filipesilva

@filipesilva Here are the logs for failing build: https://travis-ci.org/johannesjo/super-productivity/jobs/556566074 I think key are the unintended changes to the package-lock.json made here: https://github.com/johannesjo/super-productivity/commit/807a760d7d7cb9f18e706422a9f8f02af30342de

And there is the build for the commit that fixed the issue and the commit itself: https://github.com/johannesjo/super-productivity/commit/5e6b7aaf234dbac286549a6ac74957ba15589cd8 https://travis-ci.org/johannesjo/super-productivity/jobs/557364217

(also you mentioned poor JohannesHoppe instead of me again :))

johannesjo avatar Jul 16 '19 13:07 johannesjo

We were experiecing the same issue. It turned out, we imported the base scss files in most of our components. That was not really necassary. Now without setting the max-old-space-size Node option, we were able to build our apps in production mode without the error, after removing the core file imports in our components, where it was not necessary.

We also switched from dart-sass to node-sass with npm install -DE node-sass and that worked as well, without changing anything.

Below my environment. Maybe this helps :)


     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / β–³ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/


Angular CLI: 8.1.1
Node: 10.16.0
OS: darwin x64
Angular: 8.1.1
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... platform-server, router

Package                                    Version
--------------------------------------------------------------------
@angular-devkit/architect                  0.800.1
@angular-devkit/build-angular              0.801.1
@angular-devkit/build-optimizer            0.801.1
@angular-devkit/build-webpack              0.801.1
@angular-devkit/core                       8.0.6
@angular-devkit/schematics                 8.0.1
@angular/cdk                               8.0.2
@angular/flex-layout                       8.0.0-beta.26
@angular/material                          8.0.2
@ngtools/webpack                           8.1.1
@nguniversal/express-engine                8.1.1
@nguniversal/module-map-ngfactory-loader   8.1.1
@schematics/angular                        8.0.1
@schematics/update                         0.801.1
rxjs                                       6.5.2
typescript                                 3.4.5
webpack                                    4.35.2

mehrad-rafigh avatar Jul 17 '19 06:07 mehrad-rafigh

@filipesilva I doubt that it has anything todo with differential loading or that it will "stack" memory. we build in docker/k8s and we need to set max_old_space_size > 4096 even without DL. In Angular 7 or below (we used also "@angular-devkit/build-angular" < "~0.800.2") we had it set to 2048.

schmitch avatar Jul 18 '19 13:07 schmitch

Ran into this very same issue when calling "ng serve" w/ some custom configuration:

npm run env -s && ng serve --aot --configuration alpha

If you are just looking to get rolling, turning "buildOptimizer" and "optimization" flags in my configuration to false did the trick and I was able to build within seconds.

screen

epiphanizer avatar Jul 22 '19 05:07 epiphanizer

@CodeEpiphany , I knew I knew, such config for faster build time and probably smaller build memory consumption is a trading for larger build output and slower run time performance, however, missing the point of the issue mentioned in the OP.

zijianhuang avatar Jul 22 '19 05:07 zijianhuang

I experienced this with dart-sass first. We managed to fix all of those scss issues, dart-sass had. It now happened with one of my apps using the sourceMaps Object. Setting sourceMaps to false fixed my issue

mehrad-rafigh avatar Jul 26 '19 07:07 mehrad-rafigh

I had same issue with Angular 8. Windows 10 I guess different people have these issues because of different reasons.

My solution was :

node --max_old_space_size=8192 node_modules/@angular/cli/bin/ng build --prod

Now again there are two things in this, either it worked because of max_old_space_size=8192 or may be because ive different local and global cli angular version. and using above command used the local/same version of ng

bkrajendra avatar Jul 28 '19 04:07 bkrajendra

I have a relatively small app, maybe 24 components, including routes, modals, and a few classes for state management, etc. And on a 16GB machine, even with all of the suggestions posted here, there's a 3/4 chance it will hit this bug. I don't understand how it can use this much memory and really don't understand why it isn't at least trying to page it out to the SSD (sure, it would be slow, but if it goes from not building at all, to building in 10 minutes, 10x the old build time, that's still pretty great).

This is with sourcemaps off, node getting the max_old_space_size setting, buildOptimizer off, optimization off.

3 versions ago, this same app could build with a 3GB machine. Should I really roll everything back to Angular 5 or am I better off just switching to Vue?

Senneseph avatar Jul 30 '19 20:07 Senneseph

@Senneseph what is your node version? try node 10 instead of 12

maxisam avatar Jul 30 '19 21:07 maxisam

@maxisam I'm on 10.x until AWS decides to use a more recent version or I decide to create a custom Lambda Layer. But this should be working on 8.9+ according to the docs.

From https://www.npmjs.com/package/@angular/cli

Both the CLI and generated project have dependencies that require Node 8.9 or higher, together with NPM 5.5.1 or higher.

I was going to add a rant here, but I'm just going to send it to the bosses with a request to switch frameworks. It seems like this project is just in total chaos.

Here's something fun to try (8.1.3):

npm install -g @angular/cli ng create new-project cd new-project ng update "rxjs 6.4.0 -> 6.5.2 ng update rxjs"

Why does a brand new project already require a package update? 6.4.0 was in Jan. 6.5.2 was in May.

Angular CLI https://github.com/angular/angular-cli/blob/cae4a9dc4afb53292cb44ebbc644d33b7d8d159e/packages/schematics/angular/utility/latest-versions.ts

RxJs: '~6.4.0',

Angular https://github.com/angular/angular/blob/master/package.json

"rxjs": "^6.4.0",

Senneseph avatar Jul 30 '19 22:07 Senneseph

@Senneseph dude, people here are still trying to fix it. No one ignores this issue. If you have one tiny issue and make you decide to quit Angular, good luck with other "framework"s (Vue and React are not frameworks, IMO). I am sure they are so perfect with 0 issue.

I have a project with 100+components with tons of ngrx classes and services.

My build server is on node v12 with pretty average hardware. image

for es2015

Date: 2019-07-18T13:21:52.536Z - Hash: 9ba50a50277fc3c9fc2e - Time: 54734ms for es5 Date: 2019-07-18T13:23:12.900Z - Hash: 93e6713a4d03978a67fd - Time: 80111ms

It takes a bit longer than v7 but it is not something crazy.

I switched my local dev machine back to node v10 on the very first day I upgrade to V8 but I haven't done anything to build server because I am confidence that CLI team will figure this out.

Here is a place for people to work on issues not a place to vent.

I don't even know what is wrong with the update? There is no breaking change on rxjs from 6.4.0 to 6.5.2.

maxisam avatar Jul 31 '19 15:07 maxisam

@maxisam

I definitely appreciate everyone's hard work. I initially chose Angular because it seemed to be the best organized and most holistically thought-out project.

The issue is not whether people are working hard on solving this problem. The issue is that it should have been solved before it was released and declared ready for public use.

As for the rxjs thing, there shouldn't be any breaking changes between the versions. The problem is that the comments read "// These versions should be kept up to date with latest Angular peer dependencies." and yet someone is just typing whatever they want into the field instead of running a script to extract the exact string. And then no one tested if it was working as intended.

I imagine the Angular team is stretched too thin.

Senneseph avatar Jul 31 '19 17:07 Senneseph

@Senneseph

The issue is that it should have been solved before it was released and declared ready for public use.

You know this is BS right? There is no bug patch for Vue or React?

IMHO, V8 is ready. I have used it for a while. This issue doesn't really stop everyone. No one in our team(5+) has this issue. We have 10ish projects using Angular 7/8 with AOT and Build Optimizer on.

We do see the build time issue but nothing stop us to build.

Did you try to install node-sass, style-loader and sass-loader? (Mine works either way but you should try it.)

maxisam avatar Jul 31 '19 18:07 maxisam