Skip to content

native-federation-v4 imports mrmime without declaring it as a dependency #100

Description

@Ionaru

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

  1. Migrate a project to the bridge (update-v4), leaving the v3 package installed. The build works, because mrmime resolves through v3.
  2. npm uninstall @angular-architects/native-federation
  3. 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.

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