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).
31 lines
1.3 KiB
JSON
31 lines
1.3 KiB
JSON
{
|
|
"name": "notelett-workspace",
|
|
"private": true,
|
|
"packageManager": "pnpm@10.6.5",
|
|
"scripts": {
|
|
"typecheck": "pnpm --filter @notelett/backend run typecheck && pnpm --filter @notelett/web run typecheck && pnpm --filter @notelett/mobile run typecheck",
|
|
"test": "pnpm --filter @notelett/backend run test && pnpm --filter @notelett/web run test && pnpm --filter @notelett/mobile run test",
|
|
"build": "pnpm --filter @notelett/backend run build && pnpm --filter @notelett/web run build",
|
|
"install:common-plat": "BYTELYST_PACKAGE_SOURCE=common-plat pnpm install -r",
|
|
"install:gitea": "BYTELYST_PACKAGE_SOURCE=gitea pnpm install -r",
|
|
"smoke:local": "bash scripts/local-smoke.sh",
|
|
"smoke:compose": "bash scripts/compose-smoke.sh",
|
|
"seed:bootstrap": "pnpm --filter @notelett/backend run bootstrap:seed",
|
|
"audit:release-guards": "bash scripts/release-guard-audit.sh",
|
|
"audit:ui": "bash scripts/ui-drift-audit.sh",
|
|
"audit:ui:strict": "bash scripts/ui-drift-audit.sh --strict",
|
|
"dependency:health": "bash scripts/dependency-health.sh",
|
|
"verify": "pnpm run typecheck && pnpm run test && pnpm run build",
|
|
"prepare": "husky"
|
|
},
|
|
"devDependencies": {
|
|
"husky": "^9.0.0"
|
|
},
|
|
"pnpm": {
|
|
"overrides": {
|
|
"react": "19.2.0",
|
|
"react-dom": "19.2.0"
|
|
}
|
|
}
|
|
}
|