Questions tagged [angular2-aot]

Use angular2-aot for questions related to the Angular2 ahead-of-time compiler, which allows developers to deploy pre-compiled JavaScript code and HTML5 markup to the browser rather than TypeScript and Angular templates.

References

431 questions
0
votes
0 answers

Angular - Errors in ng build -aot

I created an application with Angular-cli, and when I run ng serve or ng build everything works fine, I don't have any error; but when I run ng build -aot I have the following errors : ERROR in Child compilation failed: Module build failed:…
UserName
  • 75
  • 1
  • 2
  • 16
0
votes
1 answer

Exception: Call to Node module failed with error: Prerendering failed because of error: ReferenceError: window is not defined

I am using Angular components in Angular universal sample. My Angular components are wrapper of java script widget and widget uses window.jqueryto render control. when m importing my Angular components m facing issue like below. An unhandled…
Kbvin
  • 216
  • 3
  • 13
0
votes
0 answers

Angular AoT compilation and synchronous injection?

Is it possible to make the following code AoT-compatible? interface Config { someField?: string; anotherField?: number; } @NgModule({}) export class SomeModule { protected static _config: Config; public static…
Daniel Kucal
  • 8,684
  • 6
  • 39
  • 64
0
votes
1 answer

Angular2 AOT Compilation with static external js file

Directed by the answer to my question about Server-side rendering, I'm looking at implementing AOT compilation in my Angular2 app. A bit of background to the problem I'm having: we have a build running in Visual Studio Online, which runs webpack…
Alex
  • 1,082
  • 3
  • 12
  • 23
0
votes
1 answer

Angular AOT guard throwing errors if params not in use('next' is declared but never used)

I've just upgraded to Angular 4.1.1 From what i understand, AOT is now on by default(which is great). I have a guard that don't use the next param. If i try to run the code as is i get 'next' is declared but never used. error. If i remove the…
doron
  • 1,508
  • 3
  • 18
  • 27
0
votes
1 answer

@ngtools/webpack: missing app.module.ngfactory

I am trying to use the @ngtools/webpack plugin to create an AoT version of my Angular 4 app within webpack 2, but I am having difficulty understanding what this plugin produces. In particular, I have a main.aot.ts entry point in my webpack for AoT,…
serlingpa
  • 12,024
  • 24
  • 80
  • 130
0
votes
0 answers

Angular 2/4 AoT build: spurious resolution error

I am configuring my Angular 4 app to build using AoT for production, as described in this post and GitHub repository. There have been lots of errors in this process, mainly pertaining to @types which I have resolved, but there is one curious error…
serlingpa
  • 12,024
  • 24
  • 80
  • 130
0
votes
4 answers

ng2-admin aot build unable to fetch images, fonts from assets

I am using ng2-admin template following their installation guide https://akveo.github.io/ng2-admin/articles/002-installation-guidelines/ it is running perfectly in local but when I am creating production build using "npm run build:prod:aot" and…
Suman
  • 373
  • 4
  • 9
0
votes
1 answer

Type error when testing both boolean and number in ngIf

If I have a template like this (readOnly is a boolean and arrayOfStuff is an array): Hey ng build --prod orng serve --prod both give the error: ERROR in…
WillyC
  • 3,917
  • 6
  • 35
  • 50
0
votes
1 answer

Angular CLI (AOT) gives error: ERROR in Cannot determine the module for class

I have recently migrated my project to use Angular CLI to package my project. It works fine using "ng build" but when I try to use "ng build --prod" (which in turn uses Angular AOT and other additional steps) I get these errors: ERROR in Cannot…
Vern Jensen
  • 3,449
  • 6
  • 42
  • 59
0
votes
2 answers

How to do modification in Angular 2 App after build

I am new to Angular 2. I have developed one small application. In my application there is a Login and Register page. After all done I have build my app using ng build --prod --aot All the js is minified and It all work fine. My question is now I…
Jigarb1992
  • 828
  • 2
  • 18
  • 41
0
votes
1 answer

Angular 2 AOT Compilation Error - New Instance of object when create routes

I've implemented a RouteConfigBuilder for my specific purpose clear the routes declarations with custom variables. route-builder.type.ts export class RouteBuilder { private routeConfigBuilders: RouteConfigBuilder[] = []; private…
Eron Alves
  • 23
  • 3
0
votes
0 answers

angular4 AOT is broken when I use d3.js

I am having an app using d3.js, when I compile the code using rollup, I got this error in browser, Uncaught TypeError: Cannot read property 'document' of undefined It is something like this from d3.js: !function() { var d3 = { version:…
user3006967
  • 3,291
  • 10
  • 47
  • 72
0
votes
1 answer

" warning.indexOf is not a function" rollup.js

Am getting below error message with rollup.config.js file � warning.indexOf is not a function rollup.config.js import nodeResolve from 'rollup-plugin-node-resolve' import commonjs from 'rollup-plugin-commonjs'; import uglify from…
Kbvin
  • 216
  • 3
  • 13
0
votes
0 answers

Angular 2 - File sizes after Angular Cli build

Angular Version: 2.4.10 Angular Cli Version: 1.0.0-rc.4 Build command used: ng build --aot (no --prod so i can use source-map-explorer ) I am not sure i understand how the build process organizes the modules and i must be making a mistake somewhere.…
IvanSt
  • 360
  • 4
  • 17