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

ERR_MODULE_NOT_FOUND: Cannot find module flowbite/plugin #1389

Open
2 tasks done
toteto opened this issue May 7, 2024 · 2 comments
Open
2 tasks done

ERR_MODULE_NOT_FOUND: Cannot find module flowbite/plugin #1389

toteto opened this issue May 7, 2024 · 2 comments
Assignees
Labels
🐛 bug Something isn't working confirmed This bug was confirmed

Comments

@toteto
Copy link

toteto commented May 7, 2024

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

Steps to reproduce

  1. Have ESM Tailwind config (.mjs)
  2. Import flowbite-react the new way: import flowbite from 'flowbite-react/tailwind';
  3. Add content and plugin

Current behavior

Getting error

[Failed to load PostCSS config: Failed to load PostCSS config (searchPath: /Users/antonioivanovski/dev/verified-os/applications/web/dashboard): [Error] Cannot find module '/Users/antonioivanovski/dev/verified-os/node_modules/.pnpm/flowbite-react@0.9.0_react-dom@18.2.0_react@18.2.0_tailwindcss@3.4.3/node_modules/flowbite/plugin' imported from /Users/antonioivanovski/dev/verified-os/node_modules/.pnpm/flowbite-react@0.9.0_react-dom@18.2.0_react@18.2.0_tailwindcss@3.4.3/node_modules/flowbite-react/dist/esm/tailwind.mjs
Did you mean to import flowbite@2.3.0/node_modules/flowbite/plugin.js?
Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/Users/antonioivanovski/dev/verified-os/node_modules/.pnpm/flowbite-react@0.9.0_react-dom@18.2.0_react@18.2.0_tailwindcss@3.4.3/node_modules/flowbite/plugin' imported from /Users/antonioivanovski/dev/verified-os/node_modules/.pnpm/flowbite-react@0.9.0_react-dom@18.2.0_react@18.2.0_tailwindcss@3.4.3/node_modules/flowbite-react/dist/esm/tailwind.mjs
Did you mean to import flowbite@2.3.0/node_modules/flowbite/plugin.js?
    at finalizeResolution (node:internal/modules/esm/resolve:264:11)
    at moduleResolve (node:internal/modules/esm/resolve:917:10)
    at defaultResolve (node:internal/modules/esm/resolve:1130:11)
    at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:396:12)
    at ModuleLoader.resolve (node:internal/modules/esm/loader:365:25)
    at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:240:38)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:85:39)
    at link (node:internal/modules/esm/module_job:84:36)] {
  code: 'ERR_MODULE_NOT_FOUND',
  url: 'file:///Users/antonioivanovski/dev/verified-os/node_modules/.pnpm/flowbite-react@0.9.0_react-dom@18.2.0_react@18.2.0_tailwindcss@3.4.3/node_modules/flowbite/plugin'
}

Node.js v20.11.0

Expected behavior

The config is loaded correctly

Context

The import in the flowbite-react/tailwind for the flowbitePlugin needs to be import flowbitePlugin from 'flowbite/plugin.js';

My current workaround is to do pnpm patch for this import.

@dhavalveera
Copy link
Contributor

Hey @toteto

import { content, plugin } from "flowbite-react/tailwind"

have you tried importing this way? this one works for me in my tailwind.config.ts

@SutuSebastian SutuSebastian added 🐛 bug Something isn't working confirmed This bug was confirmed labels Jun 27, 2024
@SutuSebastian SutuSebastian self-assigned this Jun 27, 2024
@toteto
Copy link
Author

toteto commented Aug 5, 2024

Hey @toteto

import { content, plugin } from "flowbite-react/tailwind"

have you tried importing this way? this one works for me in my tailwind.config.ts

Have tried with the latest 0.10.1 version, still same issue. Still resorting to the patch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working confirmed This bug was confirmed
Projects
None yet
Development

No branches or pull requests

3 participants