-
-
Notifications
You must be signed in to change notification settings - Fork 476
Closed
Labels
🐛 bugSomething isn't workingSomething isn't workingconfirmedThis bug was confirmedThis bug was confirmednextjsworkaroundMaybe a bug, but it has a workaround.Maybe a bug, but it has a workaround.
Description
Describe the bug
There are some static components that should work on server components (Next.js 13), for instance, the avatar component—and many others—but for some reason is throwing the error below that seems to be coming from floating-ui:
You're importing a component that needs flushSync. It only works in a Client Component but none of its parents are marked with "use client", so they're Server Components by default.
,----
5 | import { createPortal, flushSync } from 'react-dom';
: ^^^^^^^^^
`----
Maybe one of these should be marked as a client entry with "use client":
../../node_modules/.pnpm/@floating-ui+react-dom-interactions@0.9.3_2zx2umvpluuhvlq44va5bta2da/node_modules/@floating-ui/react-dom-interactions/dist/floating-ui.react-dom-interactions.mjs
To Reproduce
Steps to reproduce the behavior:
- Create a Next.js 13 project—or any other framework that uses server components.
- Render an Avatar component on a server component page.
- See the error
Expected behavior
Static components should work on server components
System information:
- Device: Macbook
- OS: Mac OS
- Browser: Chrome
- Version: Latest
Project information:
- Tailwind: 3.0.0
- Flowbite: 1.4.7
- Flowbite React: 0.1.2
- Type: Next.js 13
mpereira, multiwebinc, developomp, ulvidamirli, vyomzc and 14 more
Metadata
Metadata
Assignees
Labels
🐛 bugSomething isn't workingSomething isn't workingconfirmedThis bug was confirmedThis bug was confirmednextjsworkaroundMaybe a bug, but it has a workaround.Maybe a bug, but it has a workaround.