Skip to content

Version Mismatch Issues #1007

@spalakurla-ort

Description

@spalakurla-ort

For which library do you have a feature request?

native-federation

Information

Hi,
I am working on micro front end application where I have MFE Host and couple MFEs. And I have couple packages(core/ui/shell) which are shared across both MFE Host and MFEs.
So the problem is, when my Host use higher version of these packages and MFEs use lower version of these shared packages, when I load MFE in the host it does not load. It does not give error either.

Examples:
"@agency/core": "^1.0.10"
"@agency/shell": "^1.0.10"
"@agency/ui": "^1.0.9" I have these packages in my MFE Host

"@agency/core": "^1.0.2",
"@agency/shell": "^1.0.9",
"@agency/ui": "^1.0.9" I have these in my MFE

Due to this , I'm unable to load MFEs in Host.

I'm using "@angular-architects/native-federation": "^19.0.22"

Below is my federation.config.js for HOST:

const { withNativeFederation, shareAll } = require('@angular-architects/native-federation/config');

module.exports = withNativeFederation({
	shared: {
		...shareAll({
			singleton: true,
			strictVersion: false,
			requiredVersion: 'auto',
		}),

		'@agency/core': {
			singleton: true,
			strictVersion: false,
			requiredVersion: ">=1.0.0 <2.0.0"
		},
		'@agency/shell': {
			singleton: true,
			strictVersion: false,
			requiredVersion: ">=1.0.0 <2.0.0"
		},
		'@agency/ui': {
			singleton: true,
			strictVersion: false,
			requiredVersion: ">=1.0.0 <2.0.0"
		}
	}
});

Below is federation.config.js for MFE:

const { withNativeFederation, shareAll } = require("@angular-architects/native-federation/config");

module.exports = withNativeFederation({
	name: "orders",

	exposes: {
		"./orders": "./src/app/orders/orders.routes.ts",
		"./demo": "./src/app/demo/demo.routes.ts",
	},

	shared: {
		'@agency/core': {
			singleton: true,
			strictVersion: false,
			requiredVersion: ">=1.0.0 <2.0.0"
		},
		'@agency/shell': {
			singleton: true,
			strictVersion: false,
			requiredVersion: ">=1.0.0 <2.0.0"
		},
		'@agency/ui': {
			singleton: true,
			strictVersion: false,
			requiredVersion: ">=1.0.0 <2.0.0"
		},

		...shareAll({
			singleton: true,
			strictVersion: false,
			requiredVersion: 'auto',
		}),
	}
});

Let me know If I need to share anything else. Please help me resolve.

Describe any alternatives/workarounds you're currently using

No response

I would be willing to submit a PR to fix this issue

  • Yes
  • No

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions