Skip to content
This repository has been archived by the owner on Sep 11, 2021. It is now read-only.

"theme is not a function" error #65

Open
jaobrown opened this issue Jun 2, 2020 · 6 comments
Open

"theme is not a function" error #65

jaobrown opened this issue Jun 2, 2020 · 6 comments

Comments

@jaobrown
Copy link

jaobrown commented Jun 2, 2020

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!

@coderberry
Copy link

I'm having the same issues.

@danielt69
Copy link

tailwindcss v 1.5 - same here

@adamwathan
Copy link
Member

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.

@jaobrown
Copy link
Author

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

@IgorHalfeld
Copy link

IgorHalfeld commented Aug 29, 2020

I put

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

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

@dospolov
Copy link

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')]
  }
},

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants