Skip to content

ng build writes to stderr on successful build causing automated build to fail #3979

@schnitty

Description

@schnitty

Please provide us with the following information:

OS?

Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)

Windows 10

Versions.

Please run ng --version. If there's nothing outputted, please run in a Terminal: node --version and paste the result here:

ng --version

                         _                           _  _

__ _ _ __ __ _ _ _ | | __ _ _ __ ___ | |()
/ || '_ \ / _ || | | || | / ` || '|___ / __|| || |
| (
| || | | || (
| || |
| || || (| || | |___|| ( | || |
_
,||| || _, | _,||| _,||| _|||||
|
_/
angular-cli: 1.0.0-beta.25.5
node: 7.2.1
os: win32 x64
@angular/common: 2.4.3
@angular/compiler: 2.4.3
@angular/core: 2.4.3
@angular/forms: 2.4.3
@angular/http: 2.4.3
@angular/platform-browser: 2.4.3
@angular/platform-browser-dynamic: 2.4.3
@angular/router: 3.4.3
@angular/compiler-cli: 2.4.3

Repro steps.

Was this an app that wasn't created using the CLI? What change did you do on your code? etc.

Execute a powershell script remotely or from within Powershell ISE.
script contents:

Invoke-Expression "ng build"

The log given by the failure.

Normally this include a stack trace and some more information.

PS C:\development\somark\redeacted\client\redactedt> C:\Users\redacted\Documents\ngbuild.ps1
Hash: �[1mcbdcda25faeca314ca8a�[39m�[22m
Time: �[1m6925�[39m�[22mms
chunk {�[1m�[33m0�[39m�[22m} �[1m�[32mmain.bundle.js, main.bundle.map�[39m�[22m (main) 4.67 kB {�[1m�[33m2�[39m�[22
m}�[1m�[33m [initial]�[39m�[22m�[1m�[32m [rendered]�[39m�[22m
chunk {�[1m�[33m1�[39m�[22m} �[1m�[32mstyles.bundle.css, styles.bundle.map, styles.bundle.map�[39m�[22m (styles) 1.
77 kB {�[1m�[33m3�[39m�[22m}�[1m�[33m [initial]�[39m�[22m�[1m�[32m [rendered]�[39m�[22m
chunk {�[1m�[33m2�[39m�[22m} �[1m�[32mvendor.bundle.js, vendor.bundle.map�[39m�[22m (vendor) 2.61 MB�[1m�[33m [init
ial]�[39m�[22m�[1m�[32m [rendered]�[39m�[22m
chunk {�[1m�[33m3�[39m�[22m} �[1m�[32minline.bundle.js, inline.bundle.map�[39m�[22m (inline) 0 bytes�[1m�[33m [entr
y]�[39m�[22m�[1m�[32m [rendered]�[39m�[22m
ng : 0% compiling�������������� 10% building modules 0/1 modules 1 active multi main� �� �� �� �� �� �� �� �� ��
�� ������������������������������������������� 10% building modules 1/1 modules 0
active������������������������������������������ 10% building modules 1/2 modules 1 active multi styles� �� �� �� ��
�� �� �� �� �� �� �� �� ������������������������������������������� 10% building modules 2/2 modules 0
active������������������������������������������ 10% building modules 2/3 modules 1 active

... removed for brevity

basic chunk optimization pass 3� �� �� �� �� �� �� �� �� �� �� �� �� ������������������������ 77% chunk optimization����������������������� 78% advanced chunk optimization�������������������������������� 69% building modules 622/623 modules 1 active
...trident\client\trident\src\styles.css� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� ����������������������������������������������� 70% building modules 623/623 modules 0 active�
�� �� �� �� �� �� ���������������������������������������� 79% module and chunk tree optimization� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� ��������������������� 80% module reviving�������������������� 81% module order optimization� �� ��
���������������������������� 82% module id optimization� �� �� �� �� �� �� �� �������������������� 83% chunk reviving������������������� 84% chunk order optimization� �� �� ��������������������������� 85% chunk id optimization� �� �� �� �� �� �� �� �� ��
�� �� �� �� ������������� 86% hashing������������ 87% module assets processing� ����������������������������� 88% chunk assets processing���������������������������� 89% additional chunk assets processing� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� ��
�� �� �� �� �� �� �� ��������������� 90% recording�������������� 91% additional asset processing� �� �� ������������������������������ 92% chunk asset optimization� �� �� �� �� �� ������������������������ 94% asset optimization� �� �� �� �� �� �� �� �� ��
�������������� 95% emitting� �� �� �� �� �� �� �� �� �� �� �� �� �
At line:1 char:1

  • ng build
  •   + CategoryInfo          : NotSpecified: (  0% compiling�...� �� �� �� �� �:String) [], RemoteException
      + FullyQualifiedErrorId : NativeCommandError
    
    
    

Mention any other details that might be useful.

It seems that successful builds are writing info to stderr. This gets ignored from the command line and from powershell but not when running powershell script remotely or from within the Powershell ISE.
This has the result of breaking my CI build.

I get this error from a fresh install of angular-cli with a fresh new project using ng new.
I don't want to ignore errors within my script because when a real build error occurs it will be ignored.

NB: the project builds and creates the dist folder and that blank app works. This is just a problem for my automated build.


Thanks! We'll be in touch soon.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions