Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug]: Command Component doesn't compatible with React 19 and Next.js 15 #6601

Open
2 tasks done
ahmedkhabar opened this issue Feb 8, 2025 · 8 comments · May be fixed by #6644
Open
2 tasks done

[bug]: Command Component doesn't compatible with React 19 and Next.js 15 #6601

ahmedkhabar opened this issue Feb 8, 2025 · 8 comments · May be fixed by #6644
Labels
bug Something isn't working

Comments

@ahmedkhabar
Copy link

Describe the bug

Command Component using some deprecated React functions such as ElementRef, which give us typing errors.

Affected component/components

Command

How to reproduce

  1. Create a new Next.js 15 project using create-next-app@latest and Use TypeScript
  2. Initialize ShadcnUI and Add Command Component
  3. Open Command Component, and you will see the type errors.

Codesandbox/StackBlitz link

No response

Logs

System Info

Windows 11 64Bit
Next.js 15
React.js 19

Before submitting

  • I've made research efforts and searched the documentation
  • I've searched for existing issues
@ahmedkhabar ahmedkhabar added the bug Something isn't working label Feb 8, 2025
@thinhdo-developer
Copy link

same here

@amirho1
Copy link

amirho1 commented Feb 10, 2025

Hi @ahmedkhabar I tried to regenerate the error but I couldn't, please create Codesandbox/StackBlitz and give more information

my dependencies

  "dependencies": {
    "@radix-ui/react-dialog": "^1.1.6",
    "@radix-ui/react-slot": "^1.1.2",
    "class-variance-authority": "^0.7.1",
    "clsx": "^2.1.1",
    "cmdk": "1.0.0",
    "lucide-react": "^0.475.0",
    "next": "15.2.0-canary.48",
    "react": "^19.0.0",
    "react-dom": "^19.0.0",
    "tailwind-merge": "^3.0.1",
    "tailwindcss-animate": "^1.0.7"
  },
  "devDependencies": {
    "@eslint/eslintrc": "^3",
    "@tailwindcss/postcss": "^4",
    "@types/node": "^20",
    "@types/react": "^19",
    "@types/react-dom": "^19",
    "eslint": "^9",
    "eslint-config-next": "15.2.0-canary.48",
    "tailwindcss": "^4",
    "typescript": "^5"
  }

@ahmedkhabar
Copy link
Author

ahmedkhabar commented Feb 11, 2025

@amirho1 This is a GitHub repo for the code source.
https://github.com/ahmedkhabar/shadcn-command-react-19.git

Note:
If you try to use the CommandDemo on the home page for example, it works, but you can't build the app because of the Type Errors.

@padukadafa
Copy link

same here

@longzheng
Copy link
Contributor

You can fix this by manually updating the cmdk package to 1.0.4

    "dependencies": {
-        "cmdk": "1.0.0",
+        "cmdk": "^1.0.4",

@longzheng longzheng linked a pull request Feb 14, 2025 that will close this issue
@ahmedkhabar
Copy link
Author

@longzheng Thank you, this solve the issue, but still we hope for better support for React.js 19

@basilabbassv
Copy link

Worked for me.

@Benn-Lau
Copy link

You can fix this by manually updating the cmdk package to 1.0.4

"dependencies": {
  •    "cmdk": "1.0.0",
    
  •    "cmdk": "^1.0.4",
    

This works , thanks

#6597

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants