Skip to content

test(repack): skip official MF plugin tests on Node < 20.18 - #1498

Merged
dannyhw merged 1 commit into
mainfrom
fix/development-plugin-test-node-18
Oct 13, 2026
Merged

dannyhw merged 1 commit into
mainfrom
fix/development-plugin-test-node-18

Conversation

@dannyhw

@dannyhw dannyhw commented Oct 13, 2026

Copy link
Copy Markdown
Collaborator

Summary

Since #1484, the Node 18 job in Test Main Matrix fails (run):

FAIL src/plugins/__tests__/DevelopmentPlugin.test.ts
  ● Test suite failed to run
    ReferenceError: File is not defined

#1484 moved the @module-federation/enhanced devDependency from 0.8.9 to 2.9.2. In 2.9.2, @module-federation/dts-plugin loads undici@7 as soon as it is required. undici 7 needs Node >= 20.18.1 and the global File. DevelopmentPlugin.test.ts imported @module-federation/enhanced/rspack at the top level, so the whole suite failed to load on Node 18. Even a plain require('@module-federation/enhanced/rspack') fails on Node 18, which makes this a limit of MF 2.x itself. Re.Pack's runtime is unaffected, and the peer range stays >=0.6.10.

Changes:

  • The official plugin is now loaded with jest.requireActual inside the two tests that use it. Those two tests are skipped on Node < 20.18. They still build a real @module-federation/enhanced plugin on every Node version MF 2.x supports, and the logic they test doesn't depend on the Node version.
  • The ModuleFederationPluginV2 test now runs on Node 18 as well. Before, it was lost with the rest of the suite.
  • packages/repack is removed from the pnpm-workspace.yaml overrides comment, because it no longer pins an older MF version.

Test plan

  • Node 18.20.8: DevelopmentPlugin.test.ts has 1 passed and 2 skipped. The full @callstack/repack suite has 39/39 suites passing (353 tests passed, 2 skipped).
  • Node 24: all 3 DevelopmentPlugin tests pass.
  • pnpm typecheck and biome check are clean, and pnpm install --frozen-lockfile reports no lockfile change.

@module-federation/enhanced 2.x loads undici 7, which needs Node >= 20.18.1
(global File), so DevelopmentPlugin.test.ts failed to load on Node 18 after
the devDependency moved to 2.9.2. Load the official plugin lazily and skip
only the two tests that need it on older Node; the Re.Pack plugin test still
runs everywhere.

Also drop packages/repack from the overrides comment, which no longer pins
an older MF version.
@changeset-bot

changeset-bot Bot commented Oct 13, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 4e1423c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@vercel

vercel Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
repack-website Ready Ready Preview Oct 13, 2026 12:10pm UTC

Request Review

@dannyhw
dannyhw merged commit aed1802 into main Oct 13, 2026
10 checks passed
@dannyhw
dannyhw deleted the fix/development-plugin-test-node-18 branch October 13, 2026 21:51

This branch was successfully deployed

1 active deployment
Preview — 4e1423c0 Deployed Oct 13, 2026 by vercel[bot]
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.

1 participant