tailwindcss-custom-forms icon indicating copy to clipboard operation
tailwindcss-custom-forms copied to clipboard

"theme is not a function" error

Open jaobrown opened this issue 4 years ago • 6 comments

I have a website built using tailwind—it is a Gatsby site, using postcss to handle tailwind.

Built the entire site with no issues—I installed custom-forms, and nothing will run—I just get a cryptic "theme is not a function" error. I can verify if I uninstall custom-forms, and remove from tailwind config plugins, it runs. Reinstall, add as a plugin, breaks.

Anyone had anything similar?

Thanks!

jaobrown avatar Jun 02 '20 02:06 jaobrown

I'm having the same issues.

coderberry avatar Jun 26 '20 22:06 coderberry

tailwindcss v 1.5 - same here

danielt69 avatar Jul 22 '20 14:07 danielt69

Can someone share a simple GitHub repo that reproduces the issue? Better chance of me being finding 5 minutes to be able to look at it if I have a starting point instead of having to set it up from scratch.

adamwathan avatar Jul 22 '20 14:07 adamwathan

Example Repo

https://github.com/jaobrown/gatsby-tailwind-custom-forms

@adamwathan error appears in this repo.

Steps to reproduce

  1. Clone repo
  2. npm install
  3. npm start

Expected result

Server runs

Results

 ERROR #98123  WEBPACK

Generating development JavaScript bundle failed

theme is not a function

File: src/styles/main.scss

failed Building development bundle - 9.105s

jaobrown avatar Jul 22 '20 15:07 jaobrown

I put

 plugins: [
    require('@tailwindcss/custom-forms')
 ]

on tailwind.config.js instead of postcss.config.js and works for me 🎉

IgorHalfeld avatar Aug 29 '20 11:08 IgorHalfeld

fixed for me by updated gatsby-config.js from:

{
  resolve: `gatsby-plugin-sass`,
  options: {
     postCssPlugins: [require('tailwindcss'), require('./tailwind.config.js')]
  }
},

to:

{
  resolve: `gatsby-plugin-sass`,
  options: {
    postCssPlugins: [require('tailwindcss')('./tailwind.config.js')]
  }
},

dospolov avatar Sep 21 '20 02:09 dospolov