Skip to content

Instantly share code, notes, and snippets.

@devinschumacher
Created December 10, 2024 11:55
Show Gist options
  • Select an option

  • Save devinschumacher/bbf1af6035a86c339ff2454e79dabcb3 to your computer and use it in GitHub Desktop.

Select an option

Save devinschumacher/bbf1af6035a86c339ff2454e79dabcb3 to your computer and use it in GitHub Desktop.
How to fix the error "ExperimentalWarning: CommonJS module is loading ES Module" (tailwind css)

How to fix the error "ExperimentalWarning: CommonJS module is loading ES Module" (tailwind css)

If youre seeing this error:

image

because youre using a require() syntax in something like the tailwind.config.ts file...

Here's what to do

In the tailwind.config.js file:

  1. Replace const animate = require("tailwindcss-animate") with `import animate from "tailwindcs-animate"
  2. Replace module.exports = with export default
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment