Questions tagged [angular-compiler]

98 questions
90
votes
29 answers

Angular 9 - NGCC fails with an unhandled exception

Building the application after having upgraded dependencies to Angular 9 (and having performed the necessary code changes) throws an error: Compiling @angular/animations : es2015 as esm2015 Compiling @angular/animations : es2015 as esm2015 …
kay-1234
  • 901
  • 1
  • 5
  • 5
76
votes
8 answers

Could not resolve dependency: npm ERR! peer @angular/compiler@"11.2.8"

I am trying to get my app to deploy on Heroku. I was getting the "sh: 1: ng: not found" error but based on responses on here, I moved my @angular/cli, @angular-devkit/build-angular, @angular/compiler-cli, and typescript. Now I am getting a "Could…
AylaWinters
  • 1,121
  • 2
  • 7
  • 24
13
votes
1 answer

_lazy_route_resource lazy namespace object

I'm using angular compiler: const AngularCompilerPlugin = require('@ngtools/webpack').AngularCompilerPlugin; With these compiler options: "angularCompilerOptions": { "genDir": "./build/compiled", "outDir": "./build/compiled", "skipMetadataEmit":…
Usman Aziz
  • 131
  • 1
  • 5
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
7
votes
2 answers

Why use router-outlet to access component of other module doesn't need add to export

I don't understand the difference between router-outlet and module's exports array compilation strategies. router-outlet will auto generate component by ComponentFactoryResolver if you are not use router-outlet to access component of other module,…
Chunbin Li
  • 2,196
  • 1
  • 17
  • 31
7
votes
3 answers

Cannot read property 'config' of null

I am new in angular2. I have downloaded angular 2 project and tried to setup. I installed angular cli 1.0.0-rc.2 and when I am doing ng serve it is showing the below error: Cannot read property 'config' of null TypeError: Cannot read property …
Sumit Rawat
  • 151
  • 1
  • 2
  • 4
6
votes
2 answers

Dynamically compiled lazy loaded dynamic routes in Angular causing 'unsafe-eval' error

In the index.html file of the angular application after applying the Content Security Policy, the application is giving 'unsafe-eval' console error as below - core.js:4442 ERROR Error: Uncaught (in promise): EvalError: Refused to evaluate a string…
Himanshu
  • 2,251
  • 4
  • 20
  • 25
6
votes
1 answer

Angular APP_INITIALIZER in library module generates metadata compile time error: Lambda not supported

This is my ng library module code @NgModule({ imports: [NgIdleModule.forRoot()], providers: [ { provide: APP_INITIALIZER, useFactory: (idleStateChangeHandlerService: IdleStateChangeHandlerService) => () =>…
jenson-button-event
  • 18,101
  • 11
  • 89
  • 155
5
votes
1 answer

How to compile runtime-generated Angular8 code?

I'm creating Angular code at runtime, in particular, I use a SVG library in order to create a vector graphic that contains Angular code directives like (click)='myMethod()', which, in turn, call methods I've statically defined in the SVG-enclosing…
Jan B.
  • 6,030
  • 5
  • 32
  • 53
5
votes
1 answer

Illegal state: Could not load the summary for directive NgClass

When running ngc on my module, it used to work fine using angular 4.4.3 (and compiler 4.4.3). Now I upgraded to 5.0.0 (both angular and the compiler) and I have the following error: Error: Illegal state: Could not load the summary for directive…
Guillaume
  • 2,912
  • 3
  • 35
  • 59
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

Angular - useFactory - Error function calls are not supported. Consider replacing the function or lambda with a reference to an exported function

I use Angular AOT compiler version 4.1.3 I have a component library that exports a factory method that is then used to provide a service: export function libServiceFactory(itemId: string) { return (http: Http): LibService => { return new…
nest
  • 1,385
  • 1
  • 15
  • 34
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
4
votes
0 answers

Angular Compiler API replacement in Angular v13 for dynamic/runtime modules

We are using this function from the compiler compileModuleAndAllComponentsAsync to create a dynamic/runtime module. The compiler is deprecated in Angular v13. Does anyone have a similar ( dynamic/runtime module ) use case and has successfully…
zeljko_a
  • 3,725
  • 1
  • 22
  • 23
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…
1
2 3 4 5 6 7