Open hkbertoson opened 1 year ago
I also have experienced this error. Copy and pasted the code exactly from the documentation.
Same here.
"@nextui-org/accordion": "^2.0.22",
"@nextui-org/system": "^2.0.5",
"@nextui-org/theme": "^2.1.3",
Guys, please check this comment: https://github.com/nextui-org/nextui/issues/1403#issuecomment-1678863519
这是一个服务器组件,在引用的组件上方 增加
"use client";
表达这是一个客户端渲染组件。
在早前的版本中 会提示仅可在client 中使用,不知道为何 这个友好的提醒消失了
@CracKerMe thanks. your solution fixed the error
@CracKerMe ありがとう
"use client"
Work
Two reasons why this error came.
use client
pragma usage The wrong imports depend on how you installed Nextui in the project. Module/component wise of globally. For example in the module case
Correct
import { Avatar } from "@nextui-org/avatar";
import {
Dropdown,
DropdownItem,
DropdownMenu,
DropdownTrigger,
} from "@nextui-org/dropdown";
wrong
import {
Avatar,
Dropdown,
DropdownItem,
DropdownMenu,
DropdownTrigger,
} from "@nextui-org/react";
NextUI Version
2.1.12
Describe the bug
When creating an accordion like this
I get the error
Error: Unknown element <[object Object]> in collection.
Your Example Website or App
https://codesandbox.io/p/sandbox/fervent-firefly-vwvqc9
Steps to Reproduce the Bug or Issue
Create a page using the Accordion Component.
Expected behavior
https://nextui.org/docs/components/accordion
Screenshots or Videos
No response
Operating System Version
MacOS
Browser
Chrome