Skip to content

ng build Aot not working #3141

Description

@harilalinapp

When i run ng build -prod --aot i got this error.

AuthModule is not an NgModule

My module is

import { NgModule } from "@angular/core"
import { AuthRoutes } from "./auth.routes"
import { LoginComponent } from './login.component';
import { ReactiveFormsModule } from '@angular/forms';
import { CoreModule } from '../core.module';
import { MaterialModule } from '@angular/material';
import { SharedModule } from '../shared/shared.module';
@NgModule({
declarations: [
LoginComponent
],
imports: [AuthRoutes, MaterialModule, SharedModule, CoreModule, ReactiveFormsModule],
providers: []
})
export class AuthModule { }

I couldn't figure out whats wrong with my module. I have been loading this as lazy loading

import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { LoginComponent } from './auth/login.component';
import { AuthGuard } from './auth/auth.guard';
const routes: Routes = [
{
path:'',
redirectTo: '/login',
pathMatch: 'full'
},
{
path:'login',
//component: LoginComponent
loadChildren: 'app/auth/auth.module#AuthModule',
}
];
export const RoutingModule = RouterModule.forRoot(routes, { useHash: true });

Angular cli : "1.0.0-beta.19-3",

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs: investigationRequires some digging to determine if action is needed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions