bentzibentz / tailwindcss-animate.css

Animate CSS plugin for Tailwind CSS
MIT License
133 stars 17 forks source link

require(...) is not a function when installing #36

Closed raiseerco closed 1 year ago

raiseerco commented 1 year ago

My tailwind.config.js:

/** @type {import('tailwindcss').Config} */

module.exports = {
  content: [
    './pages/**/*.{js,ts,jsx,tsx}',
    './components/**/*.{js,ts,jsx,tsx}'
  ],
  theme: {
    extend: {}
  },

  plugins: [
    // Other plugins
    require('tailwindcss-animatecss')()
  ]
}

Just followed instructions on readme and got this error upon running:

ready - started server on 0.0.0.0:3000, url: http://localhost:3000
error - ./node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[3].oneOf[8].use[1]!./node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[3].oneOf[8].use[2]!./styles/globals.css
TypeError: require(...) is not a function
bentzibentz commented 1 year ago

Hi,

thanks for this issue. There is a little bug in the docs. You have to remove the brackets () at the require function require('tailwindcss-animatecss')

Example

/** @type {import('tailwindcss').Config} */

module.exports = {
  content: [
    './pages/**/*.{js,ts,jsx,tsx}',
    './components/**/*.{js,ts,jsx,tsx}'
  ],
  theme: {
    extend: {}
  },

  plugins: [
    // Other plugins
    require('tailwindcss-animatecss')
  ]
}

I will fix the docs.

bentzibentz commented 1 year ago

Documentation updated.