Remote Down causing crash in the Host Application - NX Module Federation

20 Views Asked by At

I have a NX Workspace created with Host and three remotes (remote1, remote2, remote3) in the same workspace and the 4th one is an external remote.

This external remote application can go down. If it goes down, it is crashing the entire host.

This is how my module federation config looks like

import { ModuleFederationConfig } from '@nx/webpack';

const config: ModuleFederationConfig = {
  name: 'host',
  exposes: {
    './useSharedStore': '../shared/src/lib/lib-store.ts',
  },
  remotes: [
    'remote1',
    'remote2',
    'remote3',
    ['external-app', 'http://localhost:4206/remoteEntry.js'],
  ],
};

export default config;

is there any possible way to prevent this?

0

There are 0 best solutions below