themesberg / flowbite-react

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

ERR_UNSUPPORTED_DIR_IMPORT when building a project #1326

Closed djohts closed 3 months ago

djohts commented 3 months ago

Steps to reproduce

  1. Update to flowbite-react@0.7.6
  2. Build the project via next build

Current behavior

[18:51:29.228]  ✓ Compiled successfully
[18:51:29.229]    Collecting page data ...
[18:51:29.548] unhandledRejection Error [ERR_UNSUPPORTED_DIR_IMPORT]: Directory import '/vercel/path0/node_modules/.pnpm/flowbite-react@0.7.6_react-dom@18.2.0_react@18.2.0_tailwindcss@3.4.3/node_modules/flowbite-react/lib/esm/components/Accordion' is not supported resolving ES modules imported from /vercel/path0/node_modules/.pnpm/flowbite-react@0.7.6_react-dom@18.2.0_react@18.2.0_tailwindcss@3.4.3/node_modules/flowbite-react/lib/esm/index.js
[18:51:29.548]     at finalizeResolution (node:internal/modules/esm/resolve:258:11)
[18:51:29.548]     at moduleResolve (node:internal/modules/esm/resolve:917:10)
[18:51:29.548]     at defaultResolve (node:internal/modules/esm/resolve:1130:11)
[18:51:29.548]     at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:396:12)
[18:51:29.548]     at ModuleLoader.resolve (node:internal/modules/esm/loader:365:25)
[18:51:29.548]     at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:240:38)
[18:51:29.548]     at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:85:39)
[18:51:29.548]     at link (node:internal/modules/esm/module_job:84:36) {
[18:51:29.548]   type: 'Error',
[18:51:29.548]   code: 'ERR_UNSUPPORTED_DIR_IMPORT',
[18:51:29.549]   url: 'file:///vercel/path0/node_modules/.pnpm/flowbite-react@0.7.6_react-dom@18.2.0_react@18.2.0_tailwindcss@3.4.3/node_modules/flowbite-react/lib/esm/components/Accordion'
[18:51:29.549] }
[18:51:29.607]  ELIFECYCLE  Command failed with exit code 1.
[18:51:29.624] Error: Command "pnpm run build" exited with 1

Expected behavior

Build finishes successfully.

SutuSebastian commented 3 months ago

Works on 0.7.5?

djohts commented 3 months ago

Works on 0.7.5?

Yes, the issue got introduced in 0.7.6

dragoscv commented 3 months ago

Same issue for me but on development. I resorted to downgrade to version 0.7.5

SutuSebastian commented 3 months ago

Check 0.7.8, hope it fixed everything related to imports/build/install.

SutuSebastian commented 3 months ago

Released 0.8.0 which focuses on fixing the build step of the library and streamlining the onboarding both as a contributor and as a library user.

Please read the release changelog for the breaking changes and the steps to upgrade.