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

ng build --prod no response

Open meepobrother opened this issue 9 years ago • 19 comments

Versions

Angular CLI: 1.5.3
Node: 8.9.0
OS: darwin x64
Angular: 5.0.2

@angular/cdk: 5.0.0-rc.1
@angular/cli: 1.5.3
@angular/flex-layout: 2.0.0-beta.10-4905443
@angular/material: 5.0.0-rc.1
@angular-devkit/build-optimizer: 0.0.33
@angular-devkit/core: 0.0.20
@angular-devkit/schematics: 0.0.36
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.8.3
@schematics/angular: 0.1.5
typescript: 2.4.2
webpack: 3.8.1

Repro steps

  • maybe project is to big??

Observed behavior

<!-- Normally this includes a stack trace and some more information. -->

Desired behavior

this is console, i have wait 3 hour, bug it's no response!

ng build --prod                     
 11% building modules 12/12 modules 0 activeNode#moveTo was deprecated. Use Container#append.
 92% chunk asset optimization   

meepobrother avatar Nov 22 '17 05:11 meepobrother

How big is the project? Inside your src/ directory you can run find -type f | sed -e 's/.*\.//' | sort | uniq -c to see how many files you have of each extension.

There were some memory problems in https://github.com/angular/angular-cli/issues/5618 that also caused increased build time and were fixed in https://github.com/webpack/webpack/pull/5997 (not yet released).

But I have also heard of problems with build optimizer that makes production builds take very long (https://github.com/angular/angular-cli/issues/5618#issuecomment-345227891). Can you try ng build --prod --build-optimizer=false please?

filipesilva avatar Nov 23 '17 11:11 filipesilva

I have the same problem.

using ng build --prod --build-optimizer=false modified the build time from Time: 307491ms to Time: 174678ms.

RadouaneRoufid avatar Nov 25 '17 22:11 RadouaneRoufid

I have also the same issue.

using ng build --prod --build-optimizer=false modified the build time from Time: 144838ms to Time: 80112ms. but either way i still get : Node#moveTo was deprecated. Use Container#append.

anas3636 avatar Nov 27 '17 00:11 anas3636

We have the same issue, we can fix by reverting @angular/cdk and @angular/material to beta 12

mina-skunk avatar Nov 27 '17 18:11 mina-skunk

I have the same problem after upgrading from angular-cli 1.4.2 to 1.5.3. Here is console output:

 11% building modules 13/14 modules 1 active ...MYPROJECT\src\styles.scssNode#moveTo was deprecated. Use Container#append.
 95% emitting
<--- Last few GCs --->

[4016:000000FDB93FDC40]   547128 ms: Mark-sweep 1399.6 (1721.5) -> 1399.6 (1721.5) MB, 752.0 / 0.0 ms  allocation failure GC in old space requested
[4016:000000FDB93FDC40]   547996 ms: Mark-sweep 1399.6 (1721.5) -> 1399.6 (1650.0) MB, 868.2 / 0.0 ms  last resort
[4016:000000FDB93FDC40]   548788 ms: Mark-sweep 1399.6 (1650.0) -> 1399.6 (1618.0) MB, 791.2 / 0.0 ms  last resort


<--- JS stacktrace --->

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

Security context: 00000239C1828799 <JSObject>
    1: SparseJoinWithSeparatorJS(aka SparseJoinWithSeparatorJS) [native array.js:~44] [pc=00000175C3279FA9](this=00000029B9A82311 <undefined>,p=00000003A29FE441 <JSArray[1192]>,w=00000003A29FE461 <JSArray[1192]>,q=1192,z=00000029B9A82421 <false>,A=00000029B9AD7971 <String[1]:  >)
    2: DoJoin(aka DoJoin) [native array.js:~95] [pc=00000175C24E0FDB](this=00000029B9A82311 <undefined>,p=00000003A...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory

Using ng build --prod --build-optimizer=false works ok, but with a warning Node#moveTo was deprecated. Use Container#append.

Akimi avatar Nov 28 '17 08:11 Akimi

Same problem after upgrading to anular-cli 1.5.3 and angular 5

"@angular/animations": "^5.0.0",
"@angular/cdk": "^5.0.0-rc0",
"@angular/common": "^5.0.0",
"@angular/compiler": "^5.0.0",
"@angular/core": "^5.0.0",
"@angular/flex-layout": "^2.0.0-beta.10-4905443",
"@angular/forms": "^5.0.0",
"@angular/http": "^5.0.0",
"@angular/material": "^5.0.0-rc.0",
"@angular/platform-browser": "^5.0.0",
"@angular/platform-browser-dynamic": "^5.0.0",
"@angular/platform-server": "^5.0.0",
"@angular/router": "^5.0.0",

ctrl-sflow avatar Nov 28 '17 18:11 ctrl-sflow

I have the same issue with 1.6.0:

  "dependencies": {
    "@angular/animations": "^5.1.0",
    "@angular/common": "^5.1.0",
    "@angular/compiler": "^5.1.0",
    "@angular/core": "^5.1.0",
    "@angular/forms": "^5.1.0",
    "@angular/platform-browser": "^5.1.0",
    "@angular/platform-browser-dynamic": "^5.1.0",
    "@angular/router": "^5.1.0",
    "@types/socket.io-client": "^1.4.32",
    "core-js": "^2.5.3",
    "rxjs": "^5.5.5",
    "socket.io-client": "^2.0.4",
    "tinycon": "^0.6.8",
    "zone.js": "^0.8.18"
  },
  "devDependencies": {
    "@angular-devkit/schematics": "0.0.40",
    "@angular/cli": "^1.6.0",
    "@angular/compiler-cli": "^5.1.0",
    "@angular/language-service": "^5.1.0",
    "@types/jasmine": "~2.5.54",
    "@types/jasminewd2": "~2.0.3",
    "@types/node": "^8.0.58",
    "codelyzer": "^4.0.2",
    "jasmine-core": "~2.6.4",
    "jasmine-spec-reporter": "~4.1.1",
    "karma": "~1.7.1",
    "karma-chrome-launcher": "~2.1.1",
    "karma-cli": "~1.0.1",
    "karma-coverage-istanbul-reporter": "^1.3.0",
    "karma-jasmine": "~1.1.1",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "~5.1.2",
    "ts-node": "~4.0.1",
    "tslint": "~5.3.2",
    "typescript": "^2.5.0",
    "webpack": "^3.10.0"
  }

with angular-cli 1.5.0 and typescript 2.4.2 it works perfect

PatrickWe avatar Dec 13 '17 11:12 PatrickWe

I also get the Node#moveTo was deprecated. Use Container#append. error after upgrading to Angular 5.1.1 and CLI 1.6.1.

mark-atk avatar Dec 20 '17 14:12 mark-atk

12% building modules 20/20 modules 0 activeNode#moveTo was deprecated. Use Container#append. 92% chunk asset optimization

Angular version 5.1.2, CLI version 1.6.2

achinth avatar Dec 25 '17 12:12 achinth

Hello @filipesilva,

Why this is still on need more Info ? I can give more details if you say what you need exactly.

Thank you for your help

anas3636 avatar Dec 26 '17 12:12 anas3636

Can someone provide me with a reproduction where this happens please?

filipesilva avatar Jan 09 '18 12:01 filipesilva

My Dockerfile looks like:

FROM debian:stretch

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update -y && apt-get upgrade -y
RUN apt-get install -y nano curl wget

RUN apt-get install -my gnupg
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash -
RUN apt-get install -y nodejs

# BUGFIX1 ELOOP and symlink failure => npm global verzeichnis verschieben in node sein home
RUN adduser --disabled-password --gecos '' node
USER node

RUN mkdir -p /home/node/.npm-global
ENV PATH=/home/node/.npm-global/bin:$PATH
ENV NPM_CONFIG_PREFIX=/home/node/.npm-global
RUN chown -R node:node /home/node/.npm-global/

RUN npm install -g @angular/cli
USER root
# END BUGFIX1

EXPOSE 80

COPY docker-entrypoint.sh /usr/bin/
RUN chmod +x /usr/bin/docker-entrypoint.sh
RUN sed -i -e 's/\r$//' /usr/bin/docker-entrypoint.sh # Bugfix in Windows LR
RUN ln -s /usr/bin/docker-entrypoint.sh /

ENTRYPOINT ["docker-entrypoint.sh"]

docker-entrypoint.sh

#!/bin/bash
set -e

tail -f /dev/null

PatrickWe avatar Jan 10 '18 10:01 PatrickWe

Same happened here. Almost 1 hour waiting.

jobnte avatar Feb 02 '18 10:02 jobnte

92% chunk asset optimization waiting long time .

vellengs avatar Feb 05 '18 17:02 vellengs

52% building modules 350/402 modules 52 active ...c/node_modules/z-schema/src/Errors.jsNode#moveTo was deprecated. Use Container#append.

vellengs avatar Feb 05 '18 17:02 vellengs

If some one has reproduction can you please post? Unfortunately I can only reproduce on a non open source project. It's a cli project with 3 apps and a couple "shared" folders.

find -type f | sed -e 's/.*\.//' | sort | uniq -c

2 bmp
1328 css
1 csv
5 gitkeep
104 html
1 ico
3 jpg
1 JPG
9 json
8 png
1 ps1
111 scss
12 svg
553 ts
1 txt
3 xml

ng build --app app-name --prod

10% building modules 3/6 modules 3 active ...s\mdi\css\materialdesignicons.min.cssNode#moveTo was deprecated. Use Container#append.                                                  92% chunk asset optimization<--- Last few GCs --->

[6400:000001B6DA6B76B0]   255278 ms: Mark-sweep 1410.9 (1503.8) -> 1410.9 (1503.8) MB, 1460.6 / 0.0 ms  last resort GC in old space requested


<--- JS stacktrace --->

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

Security context: 00000213D08A5EC1 <JSObject>
    2: visit [0000010B58082311 <undefined>:4898] [bytecode=00000308C8A471C9 offset=14](this=000000BAEF67F1F9 <TreeWalker map = 000002C8A2A79B51>,node=00000064461C9021 <AST_ObjectKeyVal map = 0000019BB8317A19>,descend=000002738F2FE431 <JSFunction (sfi = 00000308C8A466F9)>)
    3: _walk [0000010B58082311 <undefined>:~1225] [pc=0000039836D359D6](this=00000064461C9021 <AST_ObjectKeyVal map = 00000...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory

mina-skunk avatar Feb 06 '18 16:02 mina-skunk

The following works for me:

node --max_old_space_size=2048 ./node_modules/@angular/cli/bin/ng build --app app-name --prod

Could this be related to https://github.com/angular/angular-cli/issues/5618 or https://github.com/angular/angular/issues/12184

mina-skunk avatar Feb 15 '18 23:02 mina-skunk

I'm sorry, but we can't reproduce the problem following the instructions you provided. Remember that we have a large number of issues to resolve, and have only a limited amount of time to reproduce your issue. Short, explicit instructions make it much more likely we'll be able to reproduce the problem so we can fix it.

If the problem persists, please open a new issue following our submission guidelines.

A good way to make a minimal repro is to create a new app via ng new repro-app and adding the minimum possible code to show the problem. Then you can push this repository to github and link it here.

alan-agius4 avatar Sep 03 '18 06:09 alan-agius4

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.