fix(pnpm): add postinstall dedupe to ensure @types/react override takes effect#624
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe Changespostinstall dedupe update
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@package.json`:
- Line 10: The postinstall script in package.json is using the --check flag with
pnpm dedupe, which performs a read-only dry run without actually modifying the
lockfile or enforcing dependency overrides. Remove the --check flag from the
postinstall command to enable actual deduplication and enforce the
`@types/react`@18.3.23 override during installation, while keeping the || true to
allow the build to proceed if deduplication encounters any issues.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
b3a0c3d to
88d37ce
Compare
88d37ce to
de1f6da
Compare
Problem
PR #10480 added
react@^19.1.0toapps/cli/package.json. This caused@types/react@19to be installed alongsidewebview-ui'sreact@^18.3.1, leading to TypeScript errors like:Root Cause
The pnpm override
@types/react: 18.3.23exists in the rootpackage.json, but stale peer dependency resolution can cause@types/react@19to leak into the lockfile or node_modules during certain install scenarios.Fix
Add a
postinstallscript that runspnpm dedupe --check || trueto ensure the override always takes effect after installation:This forces pnpm to re-resolve dependencies and enforce the override, preventing version conflicts between
apps/cli(React 19) andwebview-ui(React 18).Verification
webview-uibuild passes (tsc -b && vite build)@roo-code/core@types/react@19present in lockfile or node_modules after installRelated
package.json(PR chore(deps): pin dependencies #423)Summary by CodeRabbit
Release Notes