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

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

Closed
2 tasks done
MiroslavPetrik opened this issue Feb 28, 2024 · 1 comment
Closed
2 tasks done

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

MiroslavPetrik opened this issue Feb 28, 2024 · 1 comment

Comments

@MiroslavPetrik
Copy link
Contributor

MiroslavPetrik commented Feb 28, 2024

  • I have searched the Issues to see if this bug has already been reported
  • I have tested the latest version

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

  • fails both locally and on vercel deployment
  • I've tried to install the react-icons as package dependency, (the version 4.12 which the flowbite-react uses) but it did not help.

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
Copy link
Contributor Author

MiroslavPetrik commented Feb 29, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant