#Lazily loaded module throwing error while building

5 messages · Page 1 of 1 (latest)

pallid flint
#

I am trying to lazy load a module in the following manner :
app-routing.module.ts

    path: "therapist-dashboard",
    canActivate: [TherapistAuthGuard],
    loadChildren: () => import("./therapist/therapist-routing.module").then((m) => m.TherapistRoutingModule)
}```

But when I am trying to build using **ng build --prod** 
I am getting a lot of error. I am listing a few below:
- Can't bind to 'formGroup' since it isn't a known property of 'form'. (I have already imported FormsModule and ReactiveFormsModule in therapist.module.ts)
- Can't bind to 'ngClass' since it isn't a known property of 'div'.

A lot more errors from other modules.

Please let me know how can I fix this.
#

I know I am messing with some import somewhere but I am not able to figure it out.

warped talon
#

You're lazy-loading therapist-routing.module instead of loading the therapist.module.

#

I don't know why people keep using routing modules. They're completely useless and make things more complex than they should be.

pallid flint
#

Thank you so much! I don't know why I was doing that.