Skip to content

chore(module-federation): skip webpack-based e2e tests pending webpack 5.107.0 compat#35753

Merged
FrozenPandaz merged 3 commits into
masterfrom
fix-module-federation
May 20, 2026
Merged

chore(module-federation): skip webpack-based e2e tests pending webpack 5.107.0 compat#35753
FrozenPandaz merged 3 commits into
masterfrom
fix-module-federation

Conversation

@FrozenPandaz

@FrozenPandaz FrozenPandaz commented May 20, 2026

Copy link
Copy Markdown
Contributor

Current Behavior

All webpack-based React Module Federation e2e tests started failing on 2026-05-20.

Webpack 5.107.0 (published earlier today) reorganized its internal lib/ directory into subdirectories — e.g. lib/ModuleNotFoundError.js moved to lib/errors/ModuleNotFoundError.js, lib/DllPlugin.js moved to lib/dll/DllPlugin.js, etc. @module-federation/enhanced (which our generators wire up for webpack-based host/remote apps) deep-imports require('webpack/lib/ModuleNotFoundError'), which now throws MODULE_NOT_FOUND and aborts every webpack-based MF build/serve in our react e2e suite.

Sample failure:

NX   Cannot find module 'webpack/lib/ModuleNotFoundError'
Require stack:
- node_modules/@module-federation/enhanced/dist/src/lib/sharing/resolveMatchedConfigs.js
- node_modules/@module-federation/enhanced/dist/src/lib/sharing/ConsumeSharedPlugin.js
- ...
- node_modules/@nx/module-federation/src/with-module-federation/webpack/with-module-federation.js

This is upstream's bug, not ours:

Even after the shim release lands, other deep imports may still be broken, so we want to fully decouple our CI from this until both ecosystems re-sync.

Angular MF goes through the same @module-federation/enhanced/webpack code path and would theoretically fail too, but only react tests were observed failing in CI. The angular suites are left enabled so we get a real signal if/when they hit the same issue.

Expected Behavior

CI passes. Webpack-based react MF e2e suites are temporarily skipped with describe.skip and a TODO comment linking the upstream tracking issues. Rspack-based MF e2e tests and angular MF e2e tests are untouched and continue to run.

Skipped suites:

  • e2e/react/src/module-federation/core-webpack-basic-host-remote-generation.test.ts
  • e2e/react/src/module-federation/core-webpack-basic-playwright.test.ts
  • e2e/react/src/module-federation/core-webpack-name-and-root.test.ts
  • e2e/react/src/module-federation/core-webpack-query-params.test.ts
  • e2e/react/src/module-federation/core-webpack-ssr.test.ts
  • e2e/react/src/module-federation/dynamic-federation.webpack.test.ts
  • e2e/react/src/module-federation/federate-module.webpack.test.ts
  • e2e/react/src/module-federation/independent-deployability.webpack.test.ts
  • e2e/react/src/module-federation/misc-rspack-interoperability.test.ts (both scenarios still build with webpack on one side)

Related Issue(s)

Tracking upstream:

…k 5.107.0 compatibility

webpack 5.107.0 (published 2026-05-20) reorganized lib/ into subdirectories,
breaking deep imports like require('webpack/lib/ModuleNotFoundError') used by
@module-federation/enhanced. Skip the affected e2e tests until upstream is fixed.

Refs:
- webpack/webpack#20985
- module-federation/core#4747
@FrozenPandaz FrozenPandaz requested a review from a team as a code owner May 20, 2026 17:41
@FrozenPandaz FrozenPandaz requested a review from lourw May 20, 2026 17:41
@netlify

netlify Bot commented May 20, 2026

Copy link
Copy Markdown

Deploy Preview for nx-docs ready!

Name Link
🔨 Latest commit c663378
🔍 Latest deploy log https://app.netlify.com/projects/nx-docs/deploys/6a0e0414d9bc4d0008314d8b
😎 Deploy Preview https://deploy-preview-35753--nx-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 project configuration.

@netlify

netlify Bot commented May 20, 2026

Copy link
Copy Markdown

Deploy Preview for nx-dev ready!

Name Link
🔨 Latest commit c663378
🔍 Latest deploy log https://app.netlify.com/projects/nx-dev/deploys/6a0e0414b09dbf000835deb3
😎 Deploy Preview https://deploy-preview-35753--nx-dev.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 project configuration.

@nx-cloud

nx-cloud Bot commented May 20, 2026

Copy link
Copy Markdown
Contributor

View your CI Pipeline Execution ↗ for commit c663378

Command Status Duration Result
nx affected --targets=lint,test,build,e2e,e2e-c... ✅ Succeeded 6m 49s View ↗
nx run-many -t check-imports check-lock-files c... ✅ Succeeded 2s View ↗
nx-cloud record -- pnpm nx-cloud conformance:check ✅ Succeeded 7s View ↗
nx build workspace-plugin ✅ Succeeded <1s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded 15s View ↗
nx-cloud record -- nx format:check ✅ Succeeded 4s View ↗

☁️ Nx Cloud last updated this comment at 2026-05-20 21:08:01 UTC

nx-cloud[bot]

This comment was marked as outdated.

…s confirmed failing

Reverts the angular portion of the previous commit. Angular MF goes through the
same @module-federation/enhanced/webpack code path as react and would theoretically
fail too, but only react tests were observed failing in CI. Keeping the angular
suites enabled so we get a real signal if/when they hit the same issue.
nx-cloud[bot]

This comment was marked as outdated.

Co-authored-by: FrozenPandaz <FrozenPandaz@users.noreply.github.com>

@nx-cloud nx-cloud Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nx Cloud has identified a flaky task in your failed CI:

🔂 Since the failure was identified as flaky, we triggered a CI rerun by adding an empty commit to this branch.

Nx Cloud View detailed reasoning in Nx Cloud ↗


🎓 Learn more about Self-Healing CI on nx.dev

@FrozenPandaz FrozenPandaz enabled auto-merge (squash) May 20, 2026 19:14
@FrozenPandaz FrozenPandaz merged commit a51e340 into master May 20, 2026
27 of 28 checks passed
@FrozenPandaz FrozenPandaz deleted the fix-module-federation branch May 20, 2026 21:09
FrozenPandaz added a commit that referenced this pull request May 21, 2026
…bpack 5.107.1 fix is live) (#35764)

## Current Behavior

PR #35753 skipped 9 webpack-based React Module Federation e2e suites
because webpack 5.107.0 (published 2026-05-20) reorganized its `lib/`
directory and removed `lib/ModuleNotFoundError.js`, which
`@module-federation/enhanced` deep-imports. Every webpack-based MF
build/serve in the affected suites was failing with `Cannot find module
'webpack/lib/ModuleNotFoundError'`.

## Expected Behavior

webpack 5.107.1 (published 2026-05-21) restored the path as a
backward-compat shim — `lib/ModuleNotFoundError.js` now re-exports from
`./errors/ModuleNotFoundError`. Verified locally that all 21
`webpack/lib/*` paths used by `@module-federation/enhanced` 2.4.0 /
2.5.0 now resolve in 5.107.1.

This PR removes the `describe.skip` + TODO + `//
eslint-disable-next-line jest/no-disabled-tests` lines from the 9
affected files, re-enabling:

-
`e2e/react/src/module-federation/core-webpack-basic-host-remote-generation.test.ts`
-
`e2e/react/src/module-federation/core-webpack-basic-playwright.test.ts`
- `e2e/react/src/module-federation/core-webpack-name-and-root.test.ts`
- `e2e/react/src/module-federation/core-webpack-query-params.test.ts`
- `e2e/react/src/module-federation/core-webpack-ssr.test.ts`
- `e2e/react/src/module-federation/dynamic-federation.webpack.test.ts`
- `e2e/react/src/module-federation/federate-module.webpack.test.ts`
-
`e2e/react/src/module-federation/independent-deployability.webpack.test.ts`
- `e2e/react/src/module-federation/misc-rspack-interoperability.test.ts`

## Related Issue(s)

Reverts the skip from #35753. Upstream:
- webpack/webpack#20988 (compat shim, merged)
- webpack/webpack#20989 (webpack 5.107.1
release, merged)
FrozenPandaz added a commit that referenced this pull request May 22, 2026
…k 5.107.0 compat (#35753)

## Current Behavior

All webpack-based React Module Federation e2e tests started failing on
2026-05-20.

Webpack 5.107.0 (published earlier today) reorganized its internal
`lib/` directory into subdirectories — e.g. `lib/ModuleNotFoundError.js`
moved to `lib/errors/ModuleNotFoundError.js`, `lib/DllPlugin.js` moved
to `lib/dll/DllPlugin.js`, etc. `@module-federation/enhanced` (which our
generators wire up for webpack-based host/remote apps) deep-imports
`require('webpack/lib/ModuleNotFoundError')`, which now throws
`MODULE_NOT_FOUND` and aborts every webpack-based MF build/serve in our
react e2e suite.

Sample failure:

```
NX   Cannot find module 'webpack/lib/ModuleNotFoundError'
Require stack:
- node_modules/@module-federation/enhanced/dist/src/lib/sharing/resolveMatchedConfigs.js
- node_modules/@module-federation/enhanced/dist/src/lib/sharing/ConsumeSharedPlugin.js
- ...
- node_modules/@nx/module-federation/src/with-module-federation/webpack/with-module-federation.js
```

This is upstream's bug, not ours:

- webpack/webpack#20985 — closed by webpack maintainer pointing at
module-federation
- module-federation/core#4747 — open issue for module-federation to stop
using private webpack APIs
- webpack/webpack#20988 — adds back a `lib/ModuleNotFoundError` compat
shim (merged, awaiting a webpack patch release)

Even after the shim release lands, other deep imports may still be
broken, so we want to fully decouple our CI from this until both
ecosystems re-sync.

Angular MF goes through the same `@module-federation/enhanced/webpack`
code path and would theoretically fail too, but only react tests were
observed failing in CI. The angular suites are left enabled so we get a
real signal if/when they hit the same issue.

## Expected Behavior

CI passes. Webpack-based react MF e2e suites are temporarily skipped
with `describe.skip` and a TODO comment linking the upstream tracking
issues. Rspack-based MF e2e tests and angular MF e2e tests are untouched
and continue to run.

Skipped suites:

-
`e2e/react/src/module-federation/core-webpack-basic-host-remote-generation.test.ts`
-
`e2e/react/src/module-federation/core-webpack-basic-playwright.test.ts`
- `e2e/react/src/module-federation/core-webpack-name-and-root.test.ts`
- `e2e/react/src/module-federation/core-webpack-query-params.test.ts`
- `e2e/react/src/module-federation/core-webpack-ssr.test.ts`
- `e2e/react/src/module-federation/dynamic-federation.webpack.test.ts`
- `e2e/react/src/module-federation/federate-module.webpack.test.ts`
-
`e2e/react/src/module-federation/independent-deployability.webpack.test.ts`
- `e2e/react/src/module-federation/misc-rspack-interoperability.test.ts`
(both scenarios still build with webpack on one side)

## Related Issue(s)

Tracking upstream:
- webpack/webpack#20985
- module-federation/core#4747
- webpack/webpack#20988

---------

Co-authored-by: nx-cloud[bot] <71083854+nx-cloud[bot]@users.noreply.github.com>
Co-authored-by: FrozenPandaz <FrozenPandaz@users.noreply.github.com>
(cherry picked from commit a51e340)
FrozenPandaz added a commit that referenced this pull request May 22, 2026
…bpack 5.107.1 fix is live) (#35764)

## Current Behavior

PR #35753 skipped 9 webpack-based React Module Federation e2e suites
because webpack 5.107.0 (published 2026-05-20) reorganized its `lib/`
directory and removed `lib/ModuleNotFoundError.js`, which
`@module-federation/enhanced` deep-imports. Every webpack-based MF
build/serve in the affected suites was failing with `Cannot find module
'webpack/lib/ModuleNotFoundError'`.

## Expected Behavior

webpack 5.107.1 (published 2026-05-21) restored the path as a
backward-compat shim — `lib/ModuleNotFoundError.js` now re-exports from
`./errors/ModuleNotFoundError`. Verified locally that all 21
`webpack/lib/*` paths used by `@module-federation/enhanced` 2.4.0 /
2.5.0 now resolve in 5.107.1.

This PR removes the `describe.skip` + TODO + `//
eslint-disable-next-line jest/no-disabled-tests` lines from the 9
affected files, re-enabling:

-
`e2e/react/src/module-federation/core-webpack-basic-host-remote-generation.test.ts`
-
`e2e/react/src/module-federation/core-webpack-basic-playwright.test.ts`
- `e2e/react/src/module-federation/core-webpack-name-and-root.test.ts`
- `e2e/react/src/module-federation/core-webpack-query-params.test.ts`
- `e2e/react/src/module-federation/core-webpack-ssr.test.ts`
- `e2e/react/src/module-federation/dynamic-federation.webpack.test.ts`
- `e2e/react/src/module-federation/federate-module.webpack.test.ts`
-
`e2e/react/src/module-federation/independent-deployability.webpack.test.ts`
- `e2e/react/src/module-federation/misc-rspack-interoperability.test.ts`

## Related Issue(s)

Reverts the skip from #35753. Upstream:
- webpack/webpack#20988 (compat shim, merged)
- webpack/webpack#20989 (webpack 5.107.1
release, merged)

(cherry picked from commit b6858ba)
@github-actions

Copy link
Copy Markdown
Contributor

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators May 26, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants