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]: Next 15 docs incorrectly state that CMDK works with react 19 #6200

Open
2 tasks done
mathi123 opened this issue Dec 28, 2024 · 0 comments
Open
2 tasks done

[bug]: Next 15 docs incorrectly state that CMDK works with react 19 #6200

mathi123 opened this issue Dec 28, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@mathi123
Copy link

Describe the bug

The docs state that cmdk works with react 19, but it does not?

Affected component/components

Command

How to reproduce

  1. Create a Next project
  2. Install shadcn command component
  3. Create a build
npx create-next-app@latest cmdk-react-19 --yes
cd cmdk-react-19
npx shadcn@latest add command
npm run build

Codesandbox/StackBlitz link

https://stackblitz.com/edit/stackblitz-starters-v3swgmy5

Logs

> [email protected] build
> next build

   ▲ Next.js 15.1.3

   Creating an optimized production build ...
(node:43401) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
(node:43403) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
 ✓ Compiled successfully
   Linting and checking validity of types  ...Failed to compile.

./components/ui/command.tsx:12:20
Type error: Type 'ForwardRefExoticComponent<Children & Pick<Pick<DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof HTMLAttributes<...>> & { ...; } & { ...; }, "key" | ... 1 more ... | keyof HTMLAttributes<...>> & { ...; } & RefAttributes<...>> & { ...; }' does not satisfy the constraint 'keyof IntrinsicElements | ForwardRefExoticComponent<any> | (new (props: any) => Component<any, {}, any>) | ((props: any) => ReactNode)'.
  Type 'ForwardRefExoticComponent<Children & Pick<Pick<DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof HTMLAttributes<...>> & { ...; } & { ...; }, "key" | ... 1 more ... | keyof HTMLAttributes<...>> & { ...; } & RefAttributes<...>> & { ...; }' is not assignable to type 'ForwardRefExoticComponent<any>'.
    Type 'import("/Users/mathii/projects/cmdk-react-19/node_modules/cmdk/node_modules/@types/react/index").ReactNode' is not assignable to type 'React.ReactNode'.
      Type 'ReactElement<any, string | JSXElementConstructor<any>>' is not assignable to type 'ReactNode'.
        Property 'children' is missing in type 'ReactElement<any, string | JSXElementConstructor<any>>' but required in type 'ReactPortal'.

  10 |
  11 | const Command = React.forwardRef<
> 12 |   React.ElementRef<typeof CommandPrimitive>,
     |                    ^
  13 |   React.ComponentPropsWithoutRef<typeof CommandPrimitive>
  14 | >(({ className, ...props }, ref) => (
  15 |   <CommandPrimitive

System Info

MacOS
Node v22.12.0

Before submitting

  • I've made research efforts and searched the documentation
  • I've searched for existing issues
@mathi123 mathi123 added the bug Something isn't working label Dec 28, 2024
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

1 participant