Open jaobrown opened 4 years ago
I'm having the same issues.
tailwindcss v 1.5 - same here
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.
https://github.com/jaobrown/gatsby-tailwind-custom-forms
@adamwathan error appears in this repo.
Server runs
ERROR #98123 WEBPACK
Generating development JavaScript bundle failed
theme is not a function
File: src/styles/main.scss
failed Building development bundle - 9.105s
I put
plugins: [
require('@tailwindcss/custom-forms')
]
on tailwind.config.js
instead of postcss.config.js
and works for me 🎉
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')]
}
},
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!