Skip to content

fix: remove chunks from installedChunks on fail to enable retries #3686

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

Merged
merged 6 commits into from
Apr 17, 2025

Conversation

nameofname
Copy link
Contributor

Description

This CR resolves an issue I have been researching with our next.js MF implementation. Simply put, we have been experiencing temporary outages which only occur on prod after starting a new container, or MFE revalidation where loadRemote is unable to fetch a remote MFE - the issue is sporadic and not reproducible locally, it occurs when one or more chunk files fail to download.

Related Issue

#3685

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Checklist

  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • I have updated the documentation.

Copy link

changeset-bot bot commented Apr 10, 2025

🦋 Changeset detected

Latest commit: b48ef9b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 32 packages
Name Type
@module-federation/node Patch
@module-federation/modern-js Patch
@module-federation/nextjs-mf Patch
@module-federation/runtime Patch
@module-federation/enhanced Patch
@module-federation/rspack Patch
@module-federation/webpack-bundler-runtime Patch
@module-federation/sdk Patch
@module-federation/runtime-tools Patch
@module-federation/managers Patch
@module-federation/manifest Patch
@module-federation/dts-plugin Patch
@module-federation/third-party-dts-extractor Patch
@module-federation/devtools Patch
@module-federation/bridge-react Patch
@module-federation/bridge-vue3 Patch
@module-federation/bridge-shared Patch
@module-federation/bridge-react-webpack-plugin Patch
@module-federation/retry-plugin Patch
@module-federation/data-prefetch Patch
@module-federation/rsbuild-plugin Patch
@module-federation/error-codes Patch
@module-federation/inject-external-runtime-core-plugin Patch
@module-federation/runtime-core Patch
create-module-federation Patch
@module-federation/cli Patch
@module-federation/storybook-addon Patch
@module-federation/modernjsapp Patch
@module-federation/esbuild Patch
@module-federation/utilities Patch
remote5 Patch
website-new Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

netlify bot commented Apr 10, 2025

Deploy Preview for module-federation-docs ready!

Name Link
🔨 Latest commit b48ef9b
🔍 Latest deploy log https://app.netlify.com/sites/module-federation-docs/deploys/68001595dd53de0008890ea7
😎 Deploy Preview https://deploy-preview-3686--module-federation-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@ScriptedAlchemy
Copy link
Member

Should you not still reject the promise after deleting the chunk?

@ScriptedAlchemy
Copy link
Member

Thanks for finding this tho - i think this is exactly what id need to do to also improve the 'hot reload' in the future as well

@nameofname
Copy link
Contributor Author

Should you not still reject the promise after deleting the chunk?

It does still reject, I made it so that deleteChunk returns true so the statement return deleteChunk(chunkId, installedChunks) && reject(err); does both - LMK if that's not what you meant.

@ScriptedAlchemy
Copy link
Member

ok perfect.

@ScriptedAlchemy ScriptedAlchemy merged commit 122f1b3 into module-federation:main Apr 17, 2025
14 checks passed
@joon84
Copy link

joon84 commented Apr 17, 2025

when will it be released?
we are also facing same where "angular + nx" remotes are throwing chunks missing in the host side using runtime mf 2 plugin...

@ScriptedAlchemy
Copy link
Member

use this release in the meantime, the canary will have it the feature.
https://github.com/module-federation/core/actions/runs/14545048521/job/40809311478

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants