Angular module federation load remote module - Loading chunk failed

Viewed 2051

i'm developing 2 angular project ( different repo ) started on port 4200:

project 1(host) routing

{
path: 'contact',
loadChildren: () =>
  loadRemoteModule({
    remoteEntry: 'http://localhost:3000/remoteEntry.js',
    remoteName: 'mfe1',
    exposedModule: './Module'
  })
    .then(m => m.ContactModule)
 }

project 2 (remote) webpack started on port 3000:

  name: "mfe1",
  filename: "remoteEntry.js",

  exposes: {
    './Module': './src/app/contact/contact.module.ts',
  }

the loading of remoteEntry.js works correctly, but then i got ERROR Error: Uncaught (in promise): ChunkLoadError: Loading chunk src_app_contact_contact_module_ts failed http://localhost:4200/src_app_contact_contact_module_ts.js

why the remoteEntry.js is loaded correctly on port 3000 but the module of 2nd project is loaded from port 4200 instead of http://localhost:3000/src_app_contact_contact_module_ts.js

0 Answers
Related