Ivy-ngcc: Fail to compile in rc.02
See original GitHub issue🐞 bug report
Is this a regression?
NO
Description
When I’m trying to enable the Ivy compiler options, in the postinstall
script, I receive an error:
I think it’s related by ngx-markdown
library, but I cannot recognize the error. Here is the file I think it fails.
I’ve taken a look to this issue #29835 but all seems to be ok.
🔬 Minimal Reproduction
ng new repro-app --skip-install
cd repro-app
Replace package.json with this file
npm i
🔥 Exception or Error
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Users\\Aw3sam3\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'postinstall'
1 verbose cli ]
2 info using npm@6.9.0
3 info using node@v12.1.0
4 verbose run-script [ 'postinstall' ]
5 info lifecycle application@1.10.0~postinstall: application@1.10.0
6 verbose lifecycle application@1.10.0~postinstall: unsafe-perm in lifecycle true
7 verbose lifecycle application@1.10.0~postinstall: PATH: C:\Users\Aw3sam3\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\Aw3sam3\Desktop\repro-app\node_modules\.bin;C:\Users\Aw3sam3\cmder\bin;C:\Users\Aw3sam3\cmder\vendor\bin;C:\Users\Aw3sam3\cmder\vendor\conemu-maximus5\ConEmu\Scripts;C:\Users\Aw3sam3\cmder\vendor\conemu-maximus5;C:\Users\Aw3sam3\cmder\vendor\conemu-maximus5\ConEmu;C:\Program Files\Python37\Scripts\;C:\Program Files\Python37\;c:\oracle\product\12.1.0\client_1;c:\oracle\product\12.1.0\client_1\bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;c:\oracle64\product\12.1.0\client_1;c:\oracle64\product\12.1.0\client_1\bin;C:\ProgramData\Oracle\Java\javapath;c:\Program Files (x86)\Intel\iCLS Client\;c:\Program Files\Intel\iCLS Client\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\WINDOWS\System32\OpenSSH\;C:\Users\Aw3sam3\.dnx\bin;C:\Program Files\Microsoft DNX\Dnvm\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files\Git\cmd;C:\Program Files\Microsoft VS Code\bin;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\nodejs\;C:\Program Files\Python37;C:\Python27;C:\Program Files\Microsoft\Web Platform Installer\;C:\Users\Aw3sam3\AppData\Local\Microsoft\WindowsApps;C:\Users\Aw3sam3\AppData\Roaming\npm;C:\Program Files\Git\cmd;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Users\Aw3sam3\cmder
8 verbose lifecycle application@1.10.0~postinstall: CWD: C:\Users\Aw3sam3\Desktop\repro-app
9 silly lifecycle application@1.10.0~postinstall: Args: [ '/d /s /c', 'ivy-ngcc' ]
10 silly lifecycle application@1.10.0~postinstall: Returned: code: 1 signal: null
11 info lifecycle application@1.10.0~postinstall: Failed to exec postinstall script
12 verbose stack Error: application@1.10.0 postinstall: `ivy-ngcc`
12 verbose stack Exit status 1
12 verbose stack at EventEmitter.<anonymous> (C:\Users\Aw3sam3\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\index.js:301:16)
12 verbose stack at EventEmitter.emit (events.js:196:13)
12 verbose stack at ChildProcess.<anonymous> (C:\Users\Aw3sam3\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
12 verbose stack at ChildProcess.emit (events.js:196:13)
12 verbose stack at maybeClose (internal/child_process.js:1000:16)
12 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:267:5)
13 verbose pkgid application@1.10.0
14 verbose cwd C:\Users\Aw3sam3\Desktop\repro-app
15 verbose Windows_NT 10.0.17763
16 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Aw3sam3\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run" "postinstall"
17 verbose node v12.1.0
18 verbose npm v6.9.0
19 error code ELIFECYCLE
20 error errno 1
21 error application@1.10.0 postinstall: `ivy-ngcc`
21 error Exit status 1
22 error Failed at the application@1.10.0 postinstall script.
22 error This is probably not a problem with npm. There is likely additional logging output above.
23 verbose exit [ 1, true ]
🌍 Your Environment
Angular Version:
_ _ ____ _ ___
/ \ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|
/ △ \ | '_ \ / _` | | | | |/ _` | '__| | | | | | |
/ ___ \| | | | (_| | |_| | | (_| | | | |___| |___ | |
/_/ \_\_| |_|\__, |\__,_|_|\__,_|_| \____|_____|___|
|___/
Angular CLI: 8.0.0-rc.2
Node: 12.1.0
OS: win32 x64
Angular: 8.0.0-rc.2
... 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.0-rc.2
@angular-devkit/build-angular 0.800.0-rc.2
@angular-devkit/build-optimizer 0.800.0-rc.2
@angular-devkit/build-webpack 0.800.0-rc.2
@angular-devkit/core 8.0.0-rc.2
@angular-devkit/schematics 8.0.0-rc.2
@angular/cdk 8.0.0-rc.0
@angular/material 8.0.0-rc.0
@ngtools/webpack 8.0.0-rc.2
@schematics/angular 8.0.0-rc.2
@schematics/update 0.800.0-rc.2
rxjs 6.5.1
typescript 3.4.5
webpack 4.30.0
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:12 (5 by maintainers)
Top Results From Across the Web
Compiling angular project with "An unhandled exception ...
Compiling angular project with "An unhandled exception occurred: NGCC failed" - Stack Overflow. Stack Overflow for Teams – Start collaborating and sharing ...
Read more >error: failed to initialize angular compilation - ngcc failed.
After upgrading to Angular 12 getting Error: NGCC failed ... 0.900.0-rc.8 ng-packagr 9.0.0-rc.3 rxjs 6.5.3 typescript 3.6.4 webpack 4.41.2. Open side panel.
Read more >Angular compiler options
Like the TypeScript compiler, the Angular AOT compiler also supports extends ... The pre-Ivy message extraction tooling created a variety of legacy formats ......
Read more >Update to Angular 11 Version - Angular Wiki
You must install peer dependencies yourself. npm WARN @angular-devkit/build-angular@0.1100.0 requires a peer of ng-packagr@^11.0.
Read more >Guide Leading Up to Angular 9.0.0 Release - HUSPI
ANGULAR 9.0.0-RC.12 (JANUARY 30, 2020). Features. ivy: ... ngcc: avoid error due to circular dependency in EsmDependencyHost ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@Aw3same I marked this under FW-1298 and any upcoming PR will reference this issue number, so this issue should be closed automatically once a fix gets in 😃
Thanks for reporting! You have been thorough in your investigation, your conclusion that
ngx-markdown
is a problem here is correct. It is indeed somewhat related to #29835, which was also because of an incompatibility due to ES5 downleveling.For libraries that have been compiled with
downlevelIteration
, TypeScript does not generateArray.prototype.slice()
calls (those are supported) but instead inserts a call totslib
’s__spread
helper. We need to add basic support for statically interpreting those calls to resolve this issue. The problem withtslib
mostly is that it could also be embedded into the file itself, in which case it is harder to identify and insert special behavior for it.This is also tracked internally in FW-1298