themesberg / flowbite-react

Official React components built for Flowbite and Tailwind CSS
https://flowbite-react.com
MIT License
1.82k stars 406 forks source link

Navbar.Brand does not exist #1208

Closed mkbctrl closed 7 months ago

mkbctrl commented 7 months ago
Error: Could not find the module "node_modules/flowbite-react/lib/esm/components/Navbar/Navbar.js#Navbar#Brand" in the React Client Manifest. This is probably a bug in the React Server Components bundler.

Steps to reproduce

import { Navbar } from 'flowbite-react'
import { useTranslations } from 'next-intl'
import { Path } from 'src/constants/path'
import { Logo } from 'src/ui/logo/logo'

export const PublicHeader = () => {
  const t = useTranslations('PublicLayout.nav')
  return (
    <Navbar>
      <Navbar.Brand>
        <Logo />
      </Navbar.Brand>
      <Navbar.Toggle />
      <Navbar.Collapse>
        <Navbar.Link href={Path.AuthRegister}>{t('create-account')}</Navbar.Link>
        <Navbar.Link href={Path.AuthLogin}>{t('access-account')}</Navbar.Link>
      </Navbar.Collapse>
    </Navbar>
  )
}

Current behavior

Imported docs navbar example and it fails to work

Expected behavior

To work

Context

Next.js 14

mkbctrl commented 7 months ago

Actually all elements are behaving like that. Importing directly: import { Navbar, NavbarBrand, NavbarCollapse, NavbarLink, NavbarToggle } from 'flowbite-react' solves the issue

tulup-conner commented 7 months ago

This is a documented factor of Next.js RSC compatibility. See the server.tsx variant of the code example: https://www.flowbite-react.com/docs/components/navbar#default-navbar