Hello Metronic Support Team,
I'm currently working on a Metronic project that uses Tailwind CSS and the ReUI system. According to your latest changelog on https://reui.io/docs/changelog, it states:
Migrated from tailwindcss-animate to tw-animate-css.
I followed the migration steps as expected:
1-Uninstalled the old package:
npm uninstall tailwindcss-animate
2-Installed the new package:
npm install tw-animate-css
3-Imported the CSS in my styles.css file:
@import 'tw-animate-css/dist/tw-animate.css';
However, when running the project with Vite, I get the following error:
[vite] Internal server error:
Package path ./dist/tw-animate.css is not exported from package
node_modules/tw-animate-css (see exports field in package.json)
I understand that this is related to how Vite and modern bundlers handle the "exports" field in package.json. Since tw-animate-css does not expose the CSS file via the exports field, Vite blocks direct imports from node_modules.
I’d like to know:
What is the official recommendation for using tw-animate-css with Vite?
Could you please provide guidance on how this migration should be done properly with Vite-based projects?
Thank you for your support.
Hello,
Thank you for reporting this issue and for providing detailed reproduction steps.
The error occurs because Vite strictly respects the `exports` field defined in a package’s `package.json`. Currently, the `tw-animate-css` package does not export the path:
```css
tw-animate-css/dist/tw-animate.css
```
Because of this, direct CSS imports from the `dist` directory are blocked in Vite environments.
For Vite-based projects, the recommended approach is to import the package directly without referencing the internal `dist` path:
```css
@import "tw-animate-css";
```
Alternatively, depending on your Tailwind setup, you may also use it as a plugin in your Tailwind configuration instead of importing the CSS file manually.
Example:
```js
// tailwind.config.js
import twAnimate from "tw-animate-css";
export default {
content: ["./index.html", "./src/**/*.{js,ts,jsx,tsx}"],
theme: {
extend: {},
},
plugins: [twAnimate],
};
```
Please remove the previous import:
```css
@import 'tw-animate-css/dist/tw-animate.css';
```
and replace it with either:
```css
@import "tw-animate-css";
```
or the plugin configuration above.
After updating, restart the Vite development server.
This issue is specifically related to modern bundlers such as Vite enforcing package export boundaries more strictly than older tooling.
Thank you again for bringing this to our attention.
Hi,
Please try to import it as shown below:
@import "tailwindcss";
@import "tw-animate-css"; Hi,
I already tried importing it exactly like this:
@import "tailwindcss";
@import "tw-animate-css";
but unfortunately it’s still not working on my restaurant menu website, chilimenus.com. I’m using it in my Vite + Tailwind CSS project, and the issue still remains after adding these imports.
Could you please check if there are any additional configuration steps required, especially for Vite or ReUI integration?
Thank you.