Skip to content

Conversation

@fzankl
Copy link

@fzankl fzankl commented Feb 6, 2026

Summary

The externals metadata are stored individually for each native federation build to prevent build errors.

Context

When running applications using e.g. concurrently "ng serve mfe1" "ng serve mfe2" "ng serve mfe3" "ng serve vnf-host" the host and all micro frontends are built and launched in parallel. Hence, externals metadata files are also processed in parallel.

Since the applications use the same dependency stack, different processes access the same files, which can result in empty files or exceptions such as EBUSY: resource busy or locked.

To avoid build errors, the externals metadata files should be processed and stored separately for each build.

Copy link
Collaborator

@Aukevanoost Aukevanoost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this! I have one small feedback point.

const usedPackageNamesWithTransient = addTransientDeps(
usedPackageNames,
workspaceRoot,
config.name
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unfortunately optional and can be empty, could you make the fallback consistent with the behavior in externals caching?

https://github.com/angular-architects/module-federation-plugin/blob/a61e3f1899a34875a109e7f6b47716a234e898fb/libs/native-federation-core/src/lib/core/build-for-federation.ts#L67C1-L72C4

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes absolutely sense. To avoid duplicating the logic, I have moved it to the new config-utils file.

@Aukevanoost
Copy link
Collaborator

Aukevanoost commented Feb 6, 2026

Appreciate the fix! One question, one more small request: do you mind also fixing this issue in the v4 version?
https://github.com/native-federation/native-federation-core

@Aukevanoost Aukevanoost merged commit 8972940 into angular-architects:main Feb 6, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants