themesberg / flowbite-react

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

Next.js Failed to build - Cannot get final name for export #1285

Closed MiroslavPetrik closed 7 months ago

MiroslavPetrik commented 7 months ago

Steps to reproduce

build next.js e.g:

  1. npx next build

Current behavior

it fails with the following errors:

> next build

   ▲ Next.js 14.1.0
   - Environments: .env

   Creating an optimized production build ...
Failed to compile.

./node_modules/flowbite-react/lib/esm/components/Alert/Alert.js + 1 modules
Cannot get final name for export 'HiX' of __barrel_optimize__?names=HiX!=!./node_modules/react-icons/hi/index.esm.js

./node_modules/flowbite-react/lib/esm/components/Pagination/Pagination.js + 2 modules
Cannot get final name for export 'HiChevronLeft' of __barrel_optimize__?names=HiChevronLeft,HiChevronRight!=!./node_modules/react-icons/hi/index.esm.js

./node_modules/flowbite-react/lib/esm/components/Tooltip/Tooltip.js + 2 modules
Cannot get final name for export 'Floating' of ./node_modules/flowbite-react/lib/esm/components/Floating/index.js

> Build failed because of webpack errors

Expected behavior

builds without error

Context

I think that the Alert and Tooltip might be the cause, because I was able to build the project previously (if I remember correclty, mostly I do only the local development ) but not it fails AND I've recently added features with the Alert & Tooltip for the first time. BUT I don't use Pagination at all. So its weird those components crash it.

MiroslavPetrik commented 7 months ago

I've had a Dropdown with DropdownItem using next/link in the as prop. This failed when rendered as async component with "use server" so I've changed it to client side rendering.

Looks like next.js thing