Repository navigation
fix(deps): lift the lingui cap by deduping @lingui/react in the admin bundle - #1918
Merged
Merged
Conversation
… bundle #1915 capped lingui at <6.5 because 6.6 made the editor unopenable: `useLingui()` read a null context, so the route loader threw and the screen rendered "Couldn't open the editor". The intended fix was to collapse the workspace onto one Babel major, which turns out not to be available. Three third-party packages take Babel 7 as a hard `dependencies` entry capped at ^7 — `@tanstack/router-plugin`, `babel-dead-code-elimination` (via `@tanstack/router-utils`), and `eslint-plugin-react-hooks` — while admin's rolldown/vite pipeline supplies `@babel/core@^8.0.1`. Neither side can move, so both majors coexist and pnpm keeps materializing one `@lingui/react` per peer context. Two copies on disk is fine; two copies in one bundle is not, because each carries its own LinguiContext. Vite's `resolve.dedupe` is the right lever and pins the admin bundle to a single copy, which is what the failure was actually about. A scoped `pnpm.overrides` on the macro's peers was tried first and does nothing — the instance keys come from what each consumer provides, not from the macro's own declaration. Verified by the suites that caught the regression: all 182 e2e tests pass across admin, admin-editor and the six plugins.
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
plumix-marketing | e29fa86 | Commit Preview URL Branch Preview URL |
Aug 24 2026, 05:38 PM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Lifts the
>=6.4.0 <6.5.0lingui cap that #1915 added, and closes out the secondfollow-up from that PR.
The stated plan doesn't work
The follow-up was "collapse the workspace onto one Babel major." That isn't
available. Three third-party packages take Babel 7 as a hard
dependenciesentry capped at
^7:@tanstack/router-plugin@babel/core ^7.28.5,@babel/types ^7.28.5babel-dead-code-elimination(via@tanstack/router-utils)@babel/core ^7.23.7eslint-plugin-react-hooks@babel/core ^7.24.4Meanwhile admin's rolldown/vite pipeline supplies
@babel/core ^8.0.1, and@rolldown/plugin-babel/@lingui/vite-pluginaccept^7.29 || ^8. Forcingeverything to 8 hands the three above a major they don't support; forcing 7 breaks
admin's build pipeline. Both majors coexist by necessity, so pnpm keeps
materializing one
@lingui/reactper peer context.What actually fixes it
Two copies on disk is fine. Two copies in one bundle is not, because each
carries its own
LinguiContext— which is whyuseLingui()returned null and theeditor rendered "Couldn't open the editor".
resolve.dedupein admin's Vite config is the right lever, and pins the bundle toa single copy. That's the whole change beyond the version bump.
I tried a scoped
pnpm.overrideson the macro's peers first(
@lingui/babel-plugin-lingui-macro>@babel/types). It does nothing — the peerinstance keys come from what each consumer provides down the graph, not from the
macro's own declaration. Not shipped.
Verification
All 182 e2e tests pass across every suite that could see this — admin (129),
admin-editor (33), and the six plugins (20) — run individually. The pages suite is
the one that originally caught the regression.
Plus typecheck, lint, format, test:unit, i18n, and knip (cold).
Note on the remaining duplication
The lockfile still carries two
@lingui/reactentries, and the whole Babeltoolchain is still duplicated at 7.x and 8.x. That is upstream's shape, not
something this repo can resolve today. It becomes fixable when
@tanstack/router-pluginandeslint-plugin-react-hooksmove to Babel 8 — atwhich point the
dedupeentry can go.