When attempting to build my Angular App using ng build --prod --aot, I consistently encounter the following error:
ERROR in : Illegal state: Could not load the summary for directive RouterOutlet in C:/Path-To-Project/node_modules/@angular/Router/router.d.ts.
Compiling the project with "ng serve" does not result in any error messages. I have experimented with various lazy loading implementations, but each one triggers the same error. Despite rebuilding the app from scratch and adhering strictly to Angular specifications, I always circle back to encountering this error message.
Here is my package.json:
{
"name": "Name",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build --prod",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
''' etc... '''
My app.module.ts :
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
/* etc... */
@NgModule({
declarations: [
AppComponent,
],
imports: [
BrowserModule,
AppRoutingModule,
CoreModule,
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
''' More code snippets follow '''
If anyone has a solution to this issue, please share!