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

Error when a Angular 8 Library is used as a npm package

I have built a angular 8 library that compiles perfectly and I can pack it with npm pack command to use it in other project as a npm package. When I use that library in other project I can serve it or build it in JIT mode without a problem. The…
0
votes
1 answer

Function calls are not supported in decorators in animation

ERROR in src/app/components/register/registration-form/registration-form.component.ts(27,18): Error during template compile of 'RegistrationFormComponent' Function calls are not supported in decorators but 'getanimationRule' was…
0
votes
0 answers

How to properly use HttpInterceptors with AOT enabled angular project

I am currently working on an application which uses AOT in production. The problem is that when using Httpinterceptors in dev mode using JIT mode, everything works fine. But when building it for production, all the interceptors stops working. I…
Wahib Kerkeni
  • 566
  • 7
  • 10
0
votes
1 answer

AOT errors when passing parameters to the matcher in Angular Router

I'm trying to use a closure to pass parameters to the router matcher. export function componentMatcher(component) { return (url) => { // check some condition using component return { consumed: url }; …
dex
  • 275
  • 1
  • 4
  • 10
0
votes
1 answer

@ngtools/webpack not compiling project code after migrating from Angular4 to Angular7

I migrated angular4 application to Angular7 and resolved the dev and prod builds but AOT build is not transpiling the application code(app.module). The main and polyfill bundle size is only 1 kb each. looking at the output console it seems it is not…
Pradeep
  • 19
  • 5
0
votes
2 answers

Error : Runtime compiler is not loaded : On production build in Angular 7

I have been working on angular 7 project and implemented lazy loading of a module as followed in app.route: { path: 'privacy-statement', loadChildren: () => import('./privacy-statement/privacy-statement.module').then(m =>…
Rohit Gupta
  • 1,368
  • 1
  • 14
  • 30
0
votes
2 answers

Providing service alias in Angular 7 breaks build execution

I have written a service MyService and a mocked version of it – MyServiceMock, for unit tests providing and using the mocked service's result until my BE is ready. I used MyService as alias of MyServiceMock, so I will not have to change my code in…
0
votes
1 answer

Angular AOT forRoot conditionally define providers

We have a forRoot in which we conditionally build up a providers array based on conditions in a config object. AOT doesn't like this and returns the error 'function calls are not supported in decorators but 'XxxModule' was called'. forRoot(config:…
stephan.peters
  • 963
  • 13
  • 35
0
votes
2 answers

How to use AsyncScheduler with a custom Action

I have a requirement for my RXJS stream to process chunks of data in 250 millisecond intervals when the page is not visible. Chrome is throttling these intervals to 1000 millisecond intervals. To get around this I have implemented a AsyncAction that…
colin-bilkins
  • 291
  • 1
  • 3
  • 9
0
votes
0 answers

How to decrease loading time of Angular 6 application on a server running on AWS?

I have developed an angular 6 application with --aot enabled and with lazy loading. This application on my local server is able to load in 2 sec. But when I load the same application on the AWS server, the loading time is more, and it is near to 40…
Darshan theerth
  • 516
  • 1
  • 13
  • 34
0
votes
4 answers

Property 'name' does not exist on type 'any[]'

Using [(ngModel)], I managed to set an inputs value based on a selected dropdown but I'm getting an error when compiling using ng build --configuration=prod, error shown is Property 'name' does not exist on type 'any[]' Property 'value' does not…
hafizi hamid
  • 405
  • 2
  • 20
  • 41
0
votes
1 answer

Angular production build with AOT causing stack exceeded

I'm trying to build a project for production using ng build --prod. Everything goes OK on the build, but when I try to open it on the browser it takes some time in a main-es2015 bundle parsing and returns me the following error: ERROR in Maximum…
Hugo Deiró
  • 224
  • 2
  • 13
0
votes
1 answer

Broken angular v8 build

Out of a sudden our ng build task in our vsts pipeline does not work any more. The issue first occured only on vsts - when I cleared and reinstalled the node_modules on my machine I could reproduce the issue. Therefore I am pretty sure that the…
marco birchler
  • 1,566
  • 2
  • 21
  • 45
0
votes
1 answer

Angular 5 build with --aot Module not found - @angular/platform-browser

I am trying to build the Angular 5 project using --aot option and the build fails with the following error, ERROR in ../node_modules/@angular/forms/esm5/forms.js Module not found: Error: Can't resolve '@angular/platform-browser' in '...PROJECT …
PavanBhushan
  • 106
  • 2
  • 8
0
votes
0 answers

AOT Prod build: lazy loading does not work. Angular 4.2 + Error: Cannot find module

I need help regarding AOT build with Lazy Loaded modules in Angular 4. Chunk is generated like : fw-wrapper.module.chunk.js, but can not find and throws error. I have following files: app.routing.module.ts const appRoutes: Routes = [ { path:…
Jignesh Raval
  • 587
  • 7
  • 15