Questions tagged [angular-aot]

A AOT-Compiler (Ahead of time) compiles the source code before the code is executed. Unlike the JIT-Compiler (Just in time) which compiles right when the code is executed.

The Angular Ahead-of-Time (AOT) compiler converts your Angular HTML and TypeScript code into efficient JavaScript code during the build phase before the browser downloads and runs that code.

This guide explains how to build with the AOT compiler using different compiler options and how to write Angular metadata that AOT can compile.

To find more information :

176 questions
0
votes
0 answers

Angular module when simple values are needed

I've been researching and searching for days about this problem, but haven't been able to find a solution although various variants have been posted online. When I try to compile my application with the Angular CLI in production mode, I get the…
Mathias Lykkegaard Lorenzen
  • 15,031
  • 23
  • 100
  • 187
0
votes
1 answer

Ngx translate aot compilation: changing translation in production code

I would like to compile my angular application aot. My translations are saved on the server in a database. These translations can be changed by the users. So is there any way to get these changes to work with the aot compilation if a user changed…
Franki1986
  • 1,320
  • 1
  • 15
  • 40
0
votes
1 answer

Angular CLI build minification breaks my app

After building a production version of my Angular 5 app with ng build --prod and testing it locally I run into the following issue, see the image below. Something is making a call to /es which is for sure not something I wrote myself. I think it…
Maurits Moeys
  • 1,116
  • 1
  • 12
  • 22
0
votes
1 answer

AOT Compile Failing with Material Modules

I'm getting multiple errors but they're all similar to this: ERROR in ./node_modules/@angular/material/button/typings/index.ngfactory.js Module build failed: Error: Invalid name: "@angular/material/button" at ensureValidName…
Just Dave
  • 1
  • 1
0
votes
0 answers

How can i imports an aot module (umd) in jit application?

Code import { ThridModule } from 'thrid-module'; // This is a aot compile module on `window` object with `umd` @NgModule({ imports: [ CommonModule, ThridModule ], bootstrap: [AppComponent] }) export class AppModule {} When I run this, I got…
Lon Yang
  • 696
  • 5
  • 12
0
votes
1 answer

Error TypeError: i28.ɵd is not a constructor in angular 5

I get the follow error while running the angular application (hitting application url in browser) in AOT mode using ng serve --aot command. Please not that I get no error while building application in aot mode. I get this error in browser when i hit…
Madhur Maurya
  • 1,016
  • 4
  • 19
  • 42
0
votes
1 answer

Difference in node_modules in Angular projects causing error in Angular AOT build

I have an Angular project on my local machine that builds without errors using Angular AOT and successfully runs on the server. However, when you clone the project repo and run the same build scripts after running npm install, it builds without…
Kevin Quiring
  • 639
  • 1
  • 11
  • 26
0
votes
0 answers

Angular 5 AoT- Runtime Exceptions

I am building an application with angular 5 CLI. When I build the application with dev environment it is working fine. But same code if I build with --prod and --aot flags, the application loads perfectly but I get some run-time exceptions which…
S P
  • 75
  • 6
0
votes
0 answers

Angular 5, Webpack 3. AoT breaks routing with parameters

This is my working router in the dev environment. const WEBAPP_ROUTES: Routes = [ { path: 'feed', component: LiveFeedComponent}, { path: 'register-line', component: RegisterLineComponent}, { path: 'rides', component: RidesComponent}, { path:…
Jonas Praem
  • 2,296
  • 5
  • 32
  • 53
0
votes
0 answers

Angular AOT Compilation files

I am learning how angular (4+) compile project AOT to create a library and I some questions about the files generated. I wrote a script in order to create esm and umd bundle (.js and .map.js), metadata and types for each file (ngc) and the…
Andrea11
  • 13
  • 3
0
votes
2 answers

Angular 5. Build AOT

In Angular 5 I'm having an error using: ng serve --aot if I build with JIT (at-loader) then everything is working, but I need AOT. Here you can see the discussion: https://github.com/angular/angular/issues/20639 Help me, please.
0
votes
1 answer

(ng2-charts, angular) Doughnut chart not showing up after AOT? (but filltext is working)

The doughnut chart has always worked for me until the last few days. I don't know what changed, but for some reason the actual doughnut doesn't show up after AOT build but does in development mode. I see the difference in the html, but don't know…
Kevin Quiring
  • 639
  • 1
  • 11
  • 26
0
votes
1 answer

Angular AoT Generates Incorrect External Directory References

I've been working on creating a project (all Typescript) that contains multiple Angular and NodeJS projects. That part is going pretty well, but I figured it would be pretty great if I could have a library folder under my source folder that all of…
0
votes
1 answer

Angular 4 inject console with AOT

This code fails in development mode with Ahead of time compilation. export function loggerFactory(console, http, device, injector) { return environment.production ? new LogstashLoggerService(device, injector, http) : new…
Serginho
  • 7,291
  • 2
  • 27
  • 52
0
votes
1 answer

AoT Compilation Failed - no such file or directory, lstat 'tsconfig-aot.json'

Using the Setup demo project and following the instructions here, I get the following error when running node_modules/.bin/ngc -p tsconfig-aot.json: Error: ENOENT: no such file or directory, lstat 'tsconfig-aot.json' at Object.fs.lstatSync…
user
  • 1,261
  • 2
  • 21
  • 43
1 2 3
11
12