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]: Dropdown menu content & Dropdown menu item having properties error #5893

Open
2 tasks done
rohankumarchaudhary67 opened this issue Nov 21, 2024 · 3 comments
Open
2 tasks done
Labels
bug Something isn't working

Comments

@rohankumarchaudhary67
Copy link

Describe the bug

Type '{ children: Element[]; align: string; }' is not assignable to type 'IntrinsicAttributes & RefAttributes'.
Property 'children' does not exist on type 'IntrinsicAttributes & RefAttributes'.

Affected component/components

Dropdown Menu

How to reproduce

  1. Install the Dropdown menu component in NextJs 15 with React 19 (19.0.0-rc-66855b96-20241106) project.
  2. Install the next theme and provide a theme provider.
  3. Create a mode toggle given by shadcn UI library and then it show an error on Dropdown menu content and Dropdown menu item.
  4. When you open "/components/ui/dropdown-menu.tsx" then it also show some other type errors.

Codesandbox/StackBlitz link

No response

Logs

> [email protected] build
│ > next build
│ 
│    ▲ Next.js 15.0.3
│ 
│    Creating an optimized production build ...
│  ✓ Compiled successfully
│    Linting and checking validity of types  .Failed to comp
│ ile.
│ 
│ ./src/components/mode-toggle.tsx:27:14
│ Type error: Type '{ children: Element[]; align: string; }'
│  is not assignable to type 'IntrinsicAttributes & RefAttri
│ butes<never>'.
│   Property 'children' does not exist on type 'IntrinsicAtt
│ ributes & RefAttributes<never>'.
│ 
│   25 |                 </Button>
│   26 |             </DropdownMenuTrigger>> 27 |             <DropdownMenuContent align="end">|              ^
│   28 |                 <DropdownMenuItem onClick={() => se
│ tTheme("light")}>
│   29 |                     Light
│   30 |                 </DropdownMenuItem>
│ npm error Lifecycle script `build` failed with error:
│ npm error code 1
│ npm error path /Users/rohanchaudhary/Desktop/bondra/apps/f
│ rontend
│ npm error workspace [email protected]
│ npm error location /Users/rohanchaudhary/Desktop/bondra/ap
│ ps/frontend
│ npm error command failed
│ npm error command sh -c next build
│ 
│ command finished with error: command (/Users/rohanchaudhar
│ y/Desktop/bondra/apps/frontend) /opt/homebrew/bin/npm run 
│ build exited (1)

System Info

Browser: Brave (Version 1.73.91)
Code Editor: Visual Studio Code (Version 1.95)
System: Mac OS Sequoia (Version 15.1)

Before submitting

  • I've made research efforts and searched the documentation
  • I've searched for existing issues
@rohankumarchaudhary67 rohankumarchaudhary67 added the bug Something isn't working label Nov 21, 2024
@NjayyousiN
Copy link

NjayyousiN commented Nov 21, 2024

`"use client"

import {
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuLabel,
DropdownMenuTrigger,
} from "@/components/ui/dropdown-menu";
import { Button } from "@/components/ui/button";
import { useTheme } from "next-themes";

export default function Home() {
const { setTheme } = useTheme()
return (




Open Dropdown


<DropdownMenuItem onClick={() => setTheme("light")}>
light




);
}
Hello! Am I reproducing your error correctly? I have Next.js v15.0.3 and React v19, installednext-themes`, and used the mode toggle from shadcn, but could not reproduce the error. Am I missing anything?

@jacobsamo
Copy link

experiencing the same issue

@NjayyousiN
Copy link

I am not getting an error, although I am reproducing your error. Please check if you're missing any additional error that could help resolve the problem

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

3 participants