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 failing to build because of Type mismatch #6900

Open
2 tasks done
mfluviag opened this issue Mar 10, 2025 · 2 comments
Open
2 tasks done

[bug]: Command component failing to build because of Type mismatch #6900

mfluviag opened this issue Mar 10, 2025 · 2 comments
Labels
bug Something isn't working

Comments

@mfluviag
Copy link

mfluviag commented Mar 10, 2025

Describe the bug

When building project (pnpm run build) Command component fails to build because of typescript error:

Error: src/components/shadcn/Command/Command.tsx(561,11): error TS2322: Type 'React.ReactNode' is not assignable to type 'import("C:/Users/marcf/OneDrive/Projects/air-test/node_modules/.pnpm/@types[email protected]/node_modules/@types/react/index").ReactNode'.
Type 'ReactElement<unknown, string | JSXElementConstructor>' is not assignable to type 'ReactNode'.
Property 'children' is missing in type 'ReactElement<unknown, string | JSXElementConstructor>' but required in type 'ReactPortal'.

This is happening because TypeScript is finding a mismatch between React types when using React 19. I have tried for React 18 and error doesn't happen.

Affected component/components

Command

How to reproduce

  1. Install Command component & dependencies using Next.js
  2. Make sure you are using React 19
  3. Attemp to build the project (pnpm run build) and it should fail as per Typescript error

Codesandbox/StackBlitz link

No response

Logs

System Info

Next 15
React 19
cmdk 1.0.4

Before submitting

  • I've made research efforts and searched the documentation
  • I've searched for existing issues
@mfluviag mfluviag added the bug Something isn't working label Mar 10, 2025
@mfluviag
Copy link
Author

mfluviag commented Mar 10, 2025

Solve it locally as per this thread: #1978 (comment)

However issue persists when deploying to vercel.

@mfluviag mfluviag reopened this Mar 10, 2025
@Mifayo
Copy link

Mifayo commented Mar 11, 2025

use cmdk version 1.0.4
npm install cmdk@^1.0.4

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

No branches or pull requests

2 participants