fix(workspace): pin React and React-DOM to a single version via pnpm overrides
While migrating CreateNoteModal to use @bytelyst/ui Input/Select/Textarea (which internally call React.useId), Vitest tests failed with: TypeError: Cannot read properties of null (reading 'useId') Root cause: the web package pins react@19.2.0 but @bytelyst/ui declared react: '^19.0.0' as a peer, so pnpm resolved 19.2.6 for it from the common-platform side. Two React copies coexisted (19.2.0 and 19.2.6), the @bytelyst/ui components linked against one and react-dom test-rendered against the other, and useId failed because the dispatcher belonged to a different React instance than the consumer. Fix: declare pnpm.overrides in the workspace root so the entire monorepo resolves to a single react@19.2.0 / react-dom@19.2.0 pair. Verified via 'pnpm why react' (all transitive references now point at 19.2.0) and the on-disk symlinks (web/node_modules/@bytelyst/ui/node_modules/react and common-plat/packages/ui/node_modules/react both link to .pnpm/react@19.2.0).
This commit is contained in:
parent
f4564d7cd6
commit
a83e60a60a
@ -20,5 +20,11 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"husky": "^9.0.0"
|
||||
},
|
||||
"pnpm": {
|
||||
"overrides": {
|
||||
"react": "19.2.0",
|
||||
"react-dom": "19.2.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
1376
pnpm-lock.yaml
generated
1376
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user