Summary
@angular-architects/native-federation-v4 imports mrmime in its build builder but does not declare it as a dependency. It only resolves for as long as the v3 package is still installed alongside it, so the build breaks the moment @angular-architects/native-federation is uninstalled after migrating.
Affected versions
@angular-architects/native-federation-v4@20.4.3: mrmime absent from dependencies
@angular-architects/native-federation-v4@21.2.8: mrmime absent from dependencies
The mainline package declares it, so this looks like drift in the bridge's package.json:
@angular-architects/native-federation@21.2.5: mrmime present
@angular-architects/native-federation@22.0.6: mrmime present
Cause
src/builders/build/builder.js:
import * as mrmime from 'mrmime';
// ...
const lookup = mrmime.lookup;
Reproduction
- Migrate a project to the bridge (
update-v4), leaving the v3 package installed. The build works, because mrmime resolves through v3.
npm uninstall @angular-architects/native-federation
ng build
An unhandled exception occurred: Cannot find package 'mrmime' imported from
node_modules/@angular-architects/native-federation-v4/src/builders/build/builder.js
Note this is masked under npm/yarn hoisting for as long as any other dependency happens to pull mrmime in; it surfaces reliably once nothing else provides it.
Workaround: declare mrmime in the consuming application.
Suggested fix
Add mrmime to the package's dependencies, matching the mainline package.
Summary
@angular-architects/native-federation-v4importsmrmimein its build builder but does not declare it as a dependency. It only resolves for as long as the v3 package is still installed alongside it, so the build breaks the moment@angular-architects/native-federationis uninstalled after migrating.Affected versions
@angular-architects/native-federation-v4@20.4.3:mrmimeabsent fromdependencies@angular-architects/native-federation-v4@21.2.8:mrmimeabsent fromdependenciesThe mainline package declares it, so this looks like drift in the bridge's
package.json:@angular-architects/native-federation@21.2.5:mrmimepresent@angular-architects/native-federation@22.0.6:mrmimepresentCause
src/builders/build/builder.js:Reproduction
update-v4), leaving the v3 package installed. The build works, becausemrmimeresolves through v3.npm uninstall @angular-architects/native-federationng buildNote this is masked under npm/yarn hoisting for as long as any other dependency happens to pull
mrmimein; it surfaces reliably once nothing else provides it.Workaround: declare
mrmimein the consuming application.Suggested fix
Add
mrmimeto the package'sdependencies, matching the mainline package.