themesberg / flowbite

Open-source UI component library and front-end development framework based on Tailwind CSS
https://flowbite.com
MIT License
7.55k stars 715 forks source link

Error in Tailwind Config for Charts #638

Open geraldmacasaet opened 1 year ago

geraldmacasaet commented 1 year ago

I am trying to follow the installation from this link for the Charts Tailwind CSS Chart - Flowbite

and tried adding plugins: [ require('flowbite/plugin')({ charts: true, }), // ... other plugins ]

but I got this error

[plugin:vite:css] [postcss] require(...) is not a function

awhitford commented 12 months ago

I ran into a similar issue using require with TypeScript. I resolved it by using import like this:

import flowbitePlugin from 'flowbite/plugin';

...

  plugins: [
    flowbitePlugin, // require Flowbite's plugin for Tailwind CSS
  ],
samuelna commented 6 months ago

Although the provided code resolved the issue, it still did not include the charts plugin.