You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We know that there is a problem when loading modules in a lazy way when they are outside the SPA and it is necessary to use a wrapper, but in this case it applies because the components are loaded where they have been defined.
The problem we have here is different and it occurs when the application is compiled and uses routing defined in the library. It is not able to load the component because it looks for its definition in the application itself and not in the library where it is defined.
Code SPA:
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { Lib1RoutingModule } from 'lib1';
import { Comp1Component } from './comp1.component';
@NgModule({
declarations: [
Comp1Component,
],
imports: [
// Use routing library
Lib1RoutingModule.getRoutes()
],
providers: [],
bootstrap: [Comp1Component],
exports: [RouterModule]
})
export class Comp1Module {
}
Observed behavior
The error message when compiling is:
ERROR in Could not resolve module lib1/screens/screen1/screen1.module relative to /C/Environment/Angular/Angular6/repository/spa/src/app/comp1/comp1.module.ts
The module has been defined in the library but is looking for it in the SPA.
Desired behavior
Mention any other details that might be useful (optional)
The text was updated successfully, but these errors were encountered:
Versions
Repro steps
We have a SPA that uses a library that exports a routing. The components are loaded lazy.
Code library:
We know that there is a problem when loading modules in a lazy way when they are outside the SPA and it is necessary to use a wrapper, but in this case it applies because the components are loaded where they have been defined.
The problem we have here is different and it occurs when the application is compiled and uses routing defined in the library. It is not able to load the component because it looks for its definition in the application itself and not in the library where it is defined.
Code SPA:
Observed behavior
The error message when compiling is:
The module has been defined in the library but is looking for it in the SPA.
Desired behavior
Mention any other details that might be useful (optional)
The text was updated successfully, but these errors were encountered: