Skip to content

fix: stop pinning react/react-router/react-query requiredVersion - #82

Merged
kevwilliams merged 1 commit into
mainfrom
fix/mf-shared-required-version
Sep 11, 2026
Merged

kevwilliams merged 1 commit into
mainfrom
fix/mf-shared-required-version

Conversation

@kevwilliams

Copy link
Copy Markdown
Contributor

Summary

The plugin now shows up in cloud-portal's registry (previous blockers all resolved), but fails to actually render — the browser console shows:

```
[Federation Runtime] shared singleton module react-router does not satisfy
the requirement of assistant.miloapis.com which needs ^7.0.0
[Module Federation] Failed to bridge external shared module "react-dom/client"
... React error #527
```

cloud-portal's host now ships react-router@8.3.1; this plugin's Module Federation config still hard-required ^7.0.0, so MF refuses to bridge the shared module at all — a hard crash, not a warning.

Fix

Set requiredVersion: false for react/react-dom/react-router/@tanstack/react-query, matching what the host's own federation-host.ts hostShared() already declares for these singletons ("host copy always wins"), and matching how this same file already treats @datum-cloud/portal-plugin-sdk and the datum-ui subset. compute hit and fixed this identical bug recently by bumping its pin ^7.0.0 -> ^8.0.0 — that only defers the same crash to the host's next major bump; false can't drift again.

Test plan

  • bun run typecheck / bun run build pass
  • Confirm the chat dock actually renders in cloud-portal staging (was crashing before this fix)

cloud-portal's host now ships react-router 8.3.1; this plugin's
federation config still required ^7.0.0 for the shared singleton,
which made Module Federation refuse to bridge react-router (and
cascade into react-dom/client) at runtime — a hard crash in the
browser console, not just a warning:

  [Federation Runtime] shared singleton module react-router does not
  satisfy the requirement of assistant.miloapis.com which needs ^7.0.0
  [Module Federation] Failed to bridge external shared module
  "react-dom/client" ... React error #527

The host's own federation-host.ts already declares these shared
singletons with requiredVersion: false ("host copy always wins,
regardless of the plugin's own version"); this plugin should match
that instead of enforcing a version constraint the host doesn't
honor. A version bump (matching compute's recent fix for the same
bug, ^7.0.0 -> ^8.0.0) would only defer the same crash to the host's
next major bump.
@kevwilliams
kevwilliams merged commit 5841640 into main Sep 11, 2026
5 checks passed
@kevwilliams
kevwilliams deleted the fix/mf-shared-required-version branch September 11, 2026 21:55
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.

2 participants