I’ve configured a single-spa root application along with two Angular 19 applications. The basic route configuration works fine when directly assigning components:
export const routes: Routes = [
{
path: "users",
component: UsersComponent
}
]
However, when I try to use lazy-loaded routes, the routing does not work as expected:
export const routes: Routes = [
{
path: "users",
loadChildren: () =>
import("./users/users.routes").then((m) => m.users)
}
]
In main.single-spa.ts added as below
const lifecycles = singleSpaAngular({
bootstrapFunction: (singleSpaProps) => {
return bootstrapApplication(AppComponent, {
providers: [
...getSingleSpaExtraProviders(),
...appConfig.providers,
{ provide: APP_BASE_HREF, useValue: '/user' },
],
});
},
template: '<app-user />',
Router,
NgZone,
});
I’ve configured a single-spa root application along with two Angular 19 applications. The basic route configuration works fine when directly assigning components:
However, when I try to use lazy-loaded routes, the routing does not work as expected:
In main.single-spa.ts added as below