Skip to content

Module Federation crashes when it cannot fetch one of several remotes #3877

@arivasnxt

Description

@arivasnxt

Describe the bug

When several remotes are declared in the bundler's configuration, and one of them cannot be fetched, the whole application crashes. It doesn't matter if the missing remote is not being imported, or if there is exception management with an error boundary.

This has impacted us especially since v0.7.3, when the default value for shareStrategy implied that all the remotes were fetched at startup instead of on demand.

We'd like to understand:

  • Why the internal behavior of the plugin changed with v0.7.3. It's not clear to us why changing the value of shareStrategy defines whether to fetch the remotes at startup or on demand. If we understood it correctly, shareStrategy defines the share strategy for NPM packages. In this case, we are not sharing anything.
  • If this crash is expected. We think the host application should be able to handle a graceful degradation instead of returning a total crash.

Reproduction

https://github.com/arivasnxt/mf-issue-greedy-fetching

Used Package Manager

npm

System Info

System:
    OS: macOS 15.5
    CPU: (12) arm64 Apple M3 Pro
    Memory: 554.45 MB / 36.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.16.0 - ~/.nvm/versions/node/v22.16.0/bin/node
    npm: 10.9.2 - ~/.nvm/versions/node/v22.16.0/bin/npm
  Browsers:
    Brave Browser: 135.1.77.97
    Chrome: 137.0.7151.120
    Safari: 18.5

Validations

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