fix(desktop): declare phantom deps + dedupe react-query in renderer (MUL-2651) (#3232)

Packaged renderer was bundling two copies of @tanstack/react-query because
apps/desktop imported it without declaring the dep, so Node resolution fell
through to the hoisted root variant ([email protected], pulled in by apps/mobile),
while packages/core resolved to the catalog variant ([email protected]). Two physical
paths → two QueryClientContexts → "No QueryClient set" white screen on launch.

- Declare @tanstack/react-query, lucide-react, zustand as direct deps via catalog:
  so apps/desktop resolves to the same peer variant as packages/core/views.
- Add @tanstack/react-query to renderer dedupe as a defense-in-depth bound
  against future peer drift.

Verified: realpaths under apps/desktop, packages/core, packages/views all point
to @[email protected][email protected]; production renderer bundle now
contains exactly one "use QueryClientProvider to set one" string (was 2) and
no useQueryClient\$1 suffix.

Co-authored-by: multica-agent <[email protected]>
This commit is contained in:
Bohan Jiang
2026-05-25 20:14:50 +08:00
committed by GitHub
co-authored by multica-agent
parent bf1e375015
commit e351f89843
3 changed files with 21 additions and 9 deletions
+1 -1
View File
@@ -23,7 +23,7 @@ export default defineConfig({
alias: {
"@": resolve("src/renderer/src"),
},
dedupe: ["react", "react-dom"],
dedupe: ["react", "react-dom", "@tanstack/react-query"],
},
},
});
+4 -1
View File
@@ -45,12 +45,15 @@
"@multica/core": "workspace:*",
"@multica/ui": "workspace:*",
"@multica/views": "workspace:*",
"@tanstack/react-query": "catalog:",
"electron-updater": "^6.8.3",
"fix-path": "^5.0.0",
"lucide-react": "catalog:",
"react-router-dom": "^7.6.0",
"shadcn": "^4.1.0",
"sonner": "^2.0.7",
"tw-animate-css": "^1.4.0"
"tw-animate-css": "^1.4.0",
"zustand": "catalog:"
},
"devDependencies": {
"@electron-toolkit/tsconfig": "^2.0.0",
+16 -7
View File
@@ -175,12 +175,18 @@ importers:
'@multica/views':
specifier: workspace:*
version: link:../../packages/views
'@tanstack/react-query':
specifier: 'catalog:'
version: 5.96.2([email protected])
electron-updater:
specifier: ^6.8.3
version: 6.8.3
fix-path:
specifier: ^5.0.0
version: 5.0.0
lucide-react:
specifier: 'catalog:'
version: 1.0.1([email protected])
react-router-dom:
specifier: ^7.6.0
version: 7.14.0([email protected]([email protected]))([email protected])
@@ -193,6 +199,9 @@ importers:
tw-animate-css:
specifier: ^1.4.0
version: 1.4.0
zustand:
specifier: 'catalog:'
version: 5.0.12(@types/[email protected])([email protected])([email protected])([email protected]([email protected]))
devDependencies:
'@electron-toolkit/tsconfig':
specifier: ^2.0.0
@@ -395,7 +404,7 @@ importers:
version: 55.0.15([email protected])([email protected](@babel/[email protected])(@types/[email protected])([email protected]))([email protected])
expo-router:
specifier: ~55.0.14
version: 55.0.14(fb4q2ydjsib3h2ixce2lptexem)
version: 55.0.14(28857138dad78e037ca803b5df54c4f8)
expo-secure-store:
specifier: ~55.0.13
version: 55.0.14([email protected])
@@ -11751,7 +11760,7 @@ snapshots:
ws: 8.20.1
zod: 3.25.76
optionalDependencies:
expo-router: 55.0.14(fb4q2ydjsib3h2ixce2lptexem)
expo-router: 55.0.14(28857138dad78e037ca803b5df54c4f8)
react-native: 0.83.6(@babel/[email protected])(@types/[email protected])([email protected])
transitivePeerDependencies:
- '@expo/dom-webview'
@@ -11827,7 +11836,7 @@ snapshots:
ws: 8.20.1
zod: 3.25.76
optionalDependencies:
expo-router: 55.0.14(sz7ge56yy7giy7pypish4aerfa)
expo-router: 55.0.14(8e96a26c61ba5d82f3cb5fb823dc6716)
react-native: 0.83.6(@babel/[email protected])(@types/[email protected])([email protected])
transitivePeerDependencies:
- '@expo/dom-webview'
@@ -12098,7 +12107,7 @@ snapshots:
react: 19.2.0
optionalDependencies:
'@expo/metro-runtime': 55.0.11(@expo/[email protected])([email protected])([email protected]([email protected]))([email protected](@babel/[email protected])(@types/[email protected])([email protected]))([email protected])
expo-router: 55.0.14(fb4q2ydjsib3h2ixce2lptexem)
expo-router: 55.0.14(28857138dad78e037ca803b5df54c4f8)
react-dom: 19.2.0([email protected])
transitivePeerDependencies:
- supports-color
@@ -12113,7 +12122,7 @@ snapshots:
react: 19.2.0
optionalDependencies:
'@expo/metro-runtime': 55.0.11(@expo/[email protected])([email protected])([email protected]([email protected]))([email protected](@babel/[email protected])(@types/[email protected])([email protected]))([email protected])
expo-router: 55.0.14(sz7ge56yy7giy7pypish4aerfa)
expo-router: 55.0.14(8e96a26c61ba5d82f3cb5fb823dc6716)
react-dom: 19.2.3([email protected])
transitivePeerDependencies:
- supports-color
@@ -17151,7 +17160,7 @@ snapshots:
optionalDependencies:
react-native-worklets: 0.7.4(@babel/[email protected])([email protected](@babel/[email protected])(@types/[email protected])([email protected]))([email protected])
[email protected](fb4q2ydjsib3h2ixce2lptexem):
[email protected](28857138dad78e037ca803b5df54c4f8):
dependencies:
'@expo/log-box': 55.0.12(@expo/[email protected])([email protected])([email protected](@babel/[email protected])(@types/[email protected])([email protected]))([email protected])
'@expo/metro-runtime': 55.0.11(@expo/[email protected])([email protected])([email protected]([email protected]))([email protected](@babel/[email protected])(@types/[email protected])([email protected]))([email protected])
@@ -17199,7 +17208,7 @@ snapshots:
- expo-font
- supports-color
[email protected](sz7ge56yy7giy7pypish4aerfa):
[email protected](8e96a26c61ba5d82f3cb5fb823dc6716):
dependencies:
'@expo/log-box': 55.0.12(@expo/[email protected])([email protected])([email protected](@babel/[email protected])(@types/[email protected])([email protected]))([email protected])
'@expo/metro-runtime': 55.0.11(@expo/[email protected])([email protected])([email protected]([email protected]))([email protected](@babel/[email protected])(@types/[email protected])([email protected]))([email protected])