Skip to content

fix: pin React 18 to avoid peer dependency conflicts#5

Open
Saniya1976 wants to merge 1 commit intostack-auth:mainfrom
Saniya1976:fix/react-18-peer-deps
Open

fix: pin React 18 to avoid peer dependency conflicts#5
Saniya1976 wants to merge 1 commit intostack-auth:mainfrom
Saniya1976:fix/react-18-peer-deps

Conversation

@Saniya1976
Copy link

@Saniya1976 Saniya1976 commented Dec 13, 2025

This PR addresses the peer dependency conflict caused by React 19 being resolved by default.

The change explicitly pins react and react-dom (and their corresponding type packages) to 18.3.x, which aligns with the current peer requirements of the @stackframe/* dependencies and allows npm install to complete successfully.

The remaining install output consists of peer dependency override warnings and deprecation notices from transitive dependencies, which are upstream and unaffected by this change.

Please let me know if you would prefer a different version constraint or any additional adjustments.

Summary by CodeRabbit

  • Chores
    • Updated React library dependencies to ensure compatibility and stability.

✏️ Tip: You can customize this high-level summary in your review settings.

Copilot AI review requested due to automatic review settings December 13, 2025 16:30
@vercel
Copy link
Contributor

vercel bot commented Dec 13, 2025

@Saniya1976 is attempting to deploy a commit to the Stack Auth Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link

coderabbitai bot commented Dec 13, 2025

Walkthrough

React and React DOM dependencies were downgraded from version ^19.0.0 to 18.3.1, with corresponding type definitions pinned to specific versions (18.3.12 and 18.3.1). No code logic or exported entity signatures were modified.

Changes

Cohort / File(s) Change Summary
Dependency version updates
package.json
Downgraded React and React DOM from ^19.0.0 to 18.3.1; pinned @types/react to 18.3.12 and @types/react-dom to 18.3.1

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

  • Verify version compatibility across the codebase given the React 19→18 downgrade
  • Confirm package-lock.json or yarn.lock reflects the updated versions correctly

Poem

🐰 Version bumps and dependency shifts,
From nineteen down to eighteen's gifts,
Types aligned and constraints tight,
A rabbit's work makes packages right! 🎉

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: pinning React to version 18 to resolve peer dependency conflicts, which matches the package.json update from React 19 to 18.3.1.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
package.json (1)

32-33: Minor version inconsistency between @types packages.

@types/react is pinned to 18.3.12 while @types/react-dom is pinned to 18.3.1. For consistency, consider aligning them to the same patch version (e.g., both 18.3.12 or both 18.3.1).

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a56e81b and 2ae45ce.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (1)
  • package.json (1 hunks)
🔇 Additional comments (1)
package.json (1)

24-25: Aligns with PR objective to resolve React 19 peer dependency conflicts.

The downgrade from ^19.0.0 to 18.3.1 addresses the stated issue. However, note that exact version pinning (rather than caret ranges like ^18.3.1) will prevent automatic patch updates for security fixes. This is a deliberate trade-off for reproducibility but worth being aware of if patches are released.

Please confirm that Next.js 15.1.11 is compatible with React 18.3.1 and that this pinning strategy aligns with your team's practices for dependency management.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR downgrades React and React-DOM from version 19 to 18.3.1 to resolve peer dependency conflicts with the @stackframe/stack package (v2.7.16), which requires React 18.x. The corresponding TypeScript type definition packages are also updated to align with React 18.3.x.

Key Changes:

  • Downgrade react and react-dom from ^19.0.0 to 18.3.1
  • Pin @types/react to 18.3.12 and @types/react-dom to 18.3.1

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +24 to +25
"react": "18.3.1",
"react-dom": "18.3.1",
Copy link

Copilot AI Dec 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

React and React-DOM are pinned to exact versions (18.3.1) without semver ranges. This prevents automatic installation of patch releases that may contain security fixes or bug patches.

Consider using "~18.3.1" (tilde) instead, which allows patch-level updates (18.3.x) while preventing minor/major version bumps. This would still avoid React 19 while allowing important security patches, or use "^18.3.1" to allow minor updates within the 18.x range.

Suggested change
"react": "18.3.1",
"react-dom": "18.3.1",
"react": "~18.3.1",
"react-dom": "~18.3.1",

Copilot uses AI. Check for mistakes.
"@types/react": "^18",
"@types/react-dom": "^18",
"@types/react": "18.3.12",
"@types/react-dom": "18.3.1",
Copy link

Copilot AI Dec 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The type definition packages are pinned to exact versions without semver ranges. This prevents automatic installation of patch releases that may contain type fixes or improvements.

Consider using "~18.3.12" for @types/react and "~18.3.1" for @types/react-dom to allow patch-level updates while maintaining version stability.

Suggested change
"@types/react-dom": "18.3.1",
"@types/react-dom": "~18.3.1",

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants