Questions tagged [angular-compiler-cli]
71 questions
94
votes
5 answers
What does the angular compiler "compile"?
I was asked that today and was not able to give a proper answer.
Typescript transpiles to JS. Then there is tree shaking, "less" (optional) and what else in the process of making a deployment. But nothing like that (afaik) has anything to do with…

codepleb
- 10,086
- 14
- 69
- 111
19
votes
4 answers
Angular 11 - ng serve - Option "sourceMap" is deprecated
I updated Angular project from Angular 10 to 11x. Everything works normally, except for one warning on running project using ng serve (without any option in ng serve). The warning is:
Option "sourceMap" is deprecated: Use the "sourceMap" option in…

viking
- 411
- 1
- 5
- 14
16
votes
2 answers
Angular 4 AOT compiler does not support mixins
Sometimes I use Mixins to inject repeated functions like slugUrl().
But it doesn't work with angular 4 compiler.
export function Mixin(decorators: Function[]) {
return function (classFn: Function) {
decorators.forEach(decorator => {
…

Serginho
- 7,291
- 2
- 27
- 52
13
votes
2 answers
how to use ahead-of-time compiler with angular cli webpack
is there a way to use AOT with angular cli?
I've installed the modules (@angular/compiler @angular/compiler-cli) and when I type ngc -p scr it creates the ngFactory.ts files and compiles it to dist/tsc-out (angular cli default in tsconfig)
not sure…

Han Che
- 8,239
- 19
- 70
- 116
12
votes
1 answer
'ngcc' not recognized as internal or external command
Running command npm run ngcc throws the error 'ngcc' is not recognized as an internal or external command.
package.json
{
"scripts": {
"ngcc": "ngcc"
...
},
"dependencies": {
"@angular-extensions/elements": "^9.3.0",
…

user12023283
- 179
- 1
- 1
- 9
8
votes
1 answer
How to retrieve a component's metadata in Angular
An Angular component has decorators:
@Component({ ... })
export class MyAngularComponent {
@Input() myInputParam: MyType;
@Input() myOtherInputParam: MyOtherType;
@Output() myOutputParam: MyOtherOutputType;
}
I've got an Angular library where…

Morgan Touverey Quilling
- 4,181
- 4
- 29
- 41
8
votes
1 answer
Angular 2 No provider for CompilerFactory
I'm getting this error on my Ahead-of-Time compiled application:
Error: No provider for CompilerFactory!
at NoProviderError.BaseError [as constructor] (http://localhost:5050/app.js:2413:26)
at NoProviderError.AbstractProviderError [as…

Timothy Stephens
- 81
- 1
- 3
5
votes
2 answers
AOT compiler - include lazy loaded external module
I am trying to include external module (hosted in git/npm repository) as lazy-loaded module in my Angular application.
I am compiling my external module with ngc compiler:
node_modules/.bin/ngc -p tsconfig-aot.json
This is how my compiler config…

Maciej Treder
- 11,866
- 5
- 51
- 74
5
votes
1 answer
What is the purpose of *.ngsummary.json
I've just learning about AOT, ngc etc. After running ngc I see plenty of *.ngsummary.json (in src folder, next to *.ts files).
What are they for?

dragonfly
- 17,407
- 30
- 110
- 219
5
votes
2 answers
window is undefined when used as useValue provider with Angular 4 AoT
When Angular 4.0.2 application is compiled ahead-of-time, and the provider is defined as useValue
import { OpaqueToken, Provider } from '@angular/core';
export const windowToken = new OpaqueToken('window');
export const windowProvider = { provide:…

Estus Flask
- 206,104
- 70
- 425
- 565
5
votes
2 answers
Does Angular 2 Ahead-of-Time compiler support SASS stylesheets?
I'd like to make another attempt at using Angular 2 Ahead-of-Time compilation.
This will require a significant refactoring on my part because my current setup uses a custom build process that will need to be changed.
Before I start I need to know:…

BeetleJuice
- 39,516
- 19
- 105
- 165
4
votes
3 answers
Cannot read property 'text' of undefined at NodeObject.getText at getRequiredModulePath
Error occurs while generating browser application bundles (phase: setup).
What can cause this error?
Info from console:
Generating browser application bundles (phase: setup)...
TypeError: Cannot read property 'text' of undefined
at…

John Doe
- 43
- 5
4
votes
1 answer
How to fix Angular 11 'Option "progress" is deprecated'?
I'm missing the percentage progress view while compiling an Angular 11. Usually I did:
ng serve
and saw a progress in percent while the code was compiled. Now that percentage view is gone and it's written that progress is deprecated:
Option…

Lars
- 920
- 1
- 14
- 34
4
votes
2 answers
Angular AOT Compiler - TypeError: this.compiler.analyzeModulesAsync is not a function
I'm trying to follow the ahead of time (AOT) compiler instructions here:
https://angular.io/guide/aot-compiler
The project I'm working on has been developed using the quickstart seed, as described here:
https://angular.io/guide/setup
The project has…

Rolandus
- 758
- 2
- 6
- 12
4
votes
0 answers
Generated files in angular2 AoT compilation
I'm using angular-cli to build an app.
The build runs fine with the --aot=false option.
I get errors with --aot=true, and to investigate these I'd like to look at the files generated by the compilation (ngFactory files in particular).
However I…

ldirer
- 6,606
- 3
- 24
- 30