Angular 19 Module Federation: Remote Module Load Fails with RouterModule LoadChildren

I’m working on a large monorepo project using NX and Angular 19, with multiple remotes configured through Angular’s Module Federation. This architecture allows us to split the application into smaller, independently deployable micro-frontends. Each remote represents a distinct feature module, dynamically loaded at runtime. The setup has been stable and working perfectly in Angular 14, both locally and in production. However, after updating to Angular 19, none of the routes pointing to remote modules work—they simply fail to load. Routes that are part of the main application (local routes) work as expected, but any attempt to navigate to a remote route results in an unresolved module or a silent failure. Debugging attempts suggest that the issue lies in how remote modules are being resolved by the router, but I haven’t been able to pinpoint the exact cause. Here’s a detailed breakdown of the issue:

Project Setup:

  1. Command to Start the Application:
yarn nx serve app-admin --dev-remotes=remotes-app-admin-gift-registry

This starts the app-admin project and loads the remotes-app-admin-gift-registry remote.

  1. App Module (app-admin):

The main route of app-admin is configured to load the remote module as follows:

RouterModule.forRoot([
    {
        path: '',
        loadChildren: () =>
            import('remotes-app-admin-gift-registry/Module').then(m => {
                console.log('Imported remote module', m, m.RemoteEntryModule);
                return m.RemoteEntryModule;
            }),
        canActivate: [AuthGuard, UserRoleGuard],
        data: {
            allowedRoles: [Role.SUPER_ADMIN, Role.ADMIN]
        }
    }
])
  1. Remote Module Entry:

In remotes-app-admin-gift-registry, I have the following RouterModule configuration:

RouterModule.forChild([
    {
        path: '',
        component: RemoteEntryComponent
    }
])
  1. Remote App Module:

The AppModule of remotes-app-admin-gift-registry contains:

RouterModule.forRoot([
    {
        path: '',
        loadChildren: () =>
            import('./remote-entry/entry.module').then(m => {
                console.log('Imported remote entry module', m);
                return m.RemoteEntryModule;
            })
    }
])

Debugging Steps Taken:

• I added a local module (TestModule) in app-admin with a simple route:

{
    path: 'abc',
    loadChildren: () =>
        import('./test/test.module').then(m => {
            console.log('Imported local module', m);
            return m.TestModule;
        })
}

This route works as expected, logging RouteConfigLoadEnd with the correct _loadedRoute object.

What I’ve Tried:

  1. Removing canActivate guards.

  2. Using loadRemoteModule:
    loadChildren: () =>
    loadRemoteModule({
    type: ‘manifest’,
    remoteName: ‘remotes-app-admin-gift-registry’,
    exposedModule: ‘./Module’
    }).then(m => m.RemoteEntryModule),
    or
    loadChildren: () => loadRemoteModule(‘remotes-app-admin-gift-registry’, ‘./Module’).then(m => m.RemoteEntryModule),

  3. Changing the route path from “” to a named route.

  4. Enabling enableTracing for router debugging.

Observations:

• The remote route does not generate a RouteConfigLoadEnd event.

• The local test module works as expected, suggesting the issue is specific to remote module loading.

What could be causing the remote module to fail to load in Angular 19 with Module Federation, despite it working in Angular 14? Are there additional configurations or debugging techniques I can try to resolve this issue?

1

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật