You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
Install Command component & dependencies using Next.js
Make sure you are using React 19
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
The text was updated successfully, but these errors were encountered:
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
Codesandbox/StackBlitz link
No response
Logs
System Info
Before submitting
The text was updated successfully, but these errors were encountered: