Skip to content

Conversation

@rithvikvibhu
Copy link

@rithvikvibhu rithvikvibhu commented Jul 6, 2025

Fixes #46

Currently, adding react-cmdk to a project with react 19 requires --legacy-peer-deps since react-cmdk's package.json only lists react until 18.x.

react-cmdk/package.json

Lines 61 to 64 in f41e75d

"peerDependencies": {
"react": "^16.x || ^17.x || ^18.x",
"react-dom": "^16.x || ^17.x || ^18.x"
}

# New project
❯ npm init -y
Wrote to /tmp/test-r19-cmdk/package.json:

{
  "name": "test-r19-cmdk",
  "version": "1.0.0",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "description": ""
}

# Add react 19
❯ npm i react

added 1 package, and audited 2 packages in 1s

found 0 vulnerabilities

# Add react-cmdk
❯ npm i react-cmdk
npm error code ERESOLVE
npm error ERESOLVE unable to resolve dependency tree
npm error
npm error While resolving: [email protected]
npm error Found: [email protected]
npm error node_modules/react
npm error   react@"^19.1.0" from the root project
npm error
npm error Could not resolve dependency:
npm error peer react@"^16.x || ^17.x || ^18.x" from [email protected]
npm error node_modules/react-cmdk
npm error   react-cmdk@"*" from the root project
npm error
npm error Fix the upstream dependency conflict, or retry
npm error this command with --force or --legacy-peer-deps
npm error to accept an incorrect (and potentially broken) dependency resolution.
npm error
npm error
npm error For a full report see:
npm error /home/rithvik/.npm/_logs/2025-07-06T17_22_13_252Z-eresolve-report.txt

npm error A complete log of this run can be found in: /home/rithvik/.npm/_logs/2025-07-06T17_22_13_252Z-debug-0.log

@lucasrivoiro
Copy link

I need this too. Thz!

@syntaqx
Copy link

syntaqx commented Sep 4, 2025

Would be lovely to get this merged in so I can remove my override :)

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.

Add support for react 19

3 participants