App generated with:
npx create-nx-workspace@latest frontend --preset=apps
npm install --save-dev @nx/react
nx g @nx/react:host host --directory=apps/host --remotes=first-remote
When I switched static module federation to dynamic it appears that -
character is not allowed in remote name. The application crashed at runtime with following error:
I've tried to fix it with modifying first-remote/module-federation.config.ts with:
import { ModuleFederationConfig } from '@nx/webpack';
const config: ModuleFederationConfig = {
name: 'first-remote',
library: {
name: 'first-remote',
type: 'var',
},
exposes: {
'./Module': './src/remote-entry.ts',
},
};
export default config;
what resulted with build error:
The issue can be fixed with remote name change like here: #1, but it should be not allowed upfront to set such name, or console should show some warning about it.