Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(module-federation): dynamic federation helpers should normalize remote names #29427

Merged
merged 1 commit into from
Dec 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion packages/module-federation/src/utils/get-remotes-for-host.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,16 @@ export function getRemotes(
(r) => !remotesToSkip.has(r)
);

const knownDynamicRemotes = dynamicRemotes.filter(
// With dynamic remotes, the manifest file may contain the names with `_` due to MF limitations on naming
// The project graph might contain these names with `-` rather than `_`. Check for both.
// This can occur after migration of existing remotes past Nx 19.8
let normalizedDynamicRemotes = dynamicRemotes.map((r) => {
if (context.projectGraph.nodes[r.replace(/_/g, '-')]) {
return r.replace(/_/g, '-');
}
return r;
});
const knownDynamicRemotes = normalizedDynamicRemotes.filter(
(r) => !remotesToSkip.has(r) && context.projectGraph.nodes[r]
);

Expand Down
Loading