As of v2, Tailwind CSS uses PostCSS v8, but RedwoodJS currently uses PostCSS v7. Until RedwoodJS upgrades to v8, we have to use the compatibility version of Tailwind CSS v2.
Fortunately the Tailwind CSS authors thought about this and made it really easy to do! There’s just two step:
Assuming you’ve run the setup command (yarn rw setup tailwind), in your web/package.json, change the version of "tailwindcss" to "npm:@tailwindcss/postcss7-compat":
Then run yarn install and everything should just work! (Let me know if that’s not the case. ) I’ll update the setup command so that this isn’t an issue going forward.
@dom I followed the instructions above, but got the following error:
./src/index.css (../node_modules/css-loader/dist/cjs.js??ref--4-oneOf-4-1!../node_modules/postcss-loader/dist/cjs.js??ref--4-oneOf-4-2!./src/index.css)
TypeError: value.charCodeAt is not a function
I suspected it might be that I was also using TailwindUI and now one no longer needs the plugin.
So, I removed
plugins: [require('@tailwindcss/ui')],
from my tailwind.config.js and the app seems to render now.
I recently upgrade to v0.21 from v0.16. What a jump! The upgrade is somewhat painful. I went straight to postcss v8.1.10 and postcss-loader v4.1.0. So far so good.