tailwindcss: TypeError: Invalid PostCSS Plugin found at: plugins[1]
Describe the problem:
I am following this Upgrade guide.
After running npm install tailwindcss@latest postcss@latest autoprefixer@latest, I start getting this error when running npm run serve:
TypeError: Invalid PostCSS Plugin found at: plugins[1]
I am using:
- postcss@8.1.7
- autoprefixer@10.0.2
- tailwindcss@2.0.1
Link to a minimal reproduction:
Not sure how to reproduce this on other machines. I am on Windows 10, node v14.15.1.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 14
- Comments: 26 (1 by maintainers)
@michalhudecek try with:
npm uninstall tailwindcss postcss autoprefixernpm install tailwindcss@compat postcss@^7 autoprefixer@^9Thanks Tailwind team for the 2.0 release! 🚀🎉
FYI, I was also getting
TypeError: Invalid PostCSS Plugin found at: plugins[2].Then I ran:
Now I’m getting:
TypeError: value.charCodeAt is not a functionVersions:
Here’s the stack trace: tailwind_2795.txt
@richardkmiller @MultiTijmes just comment this line
@import "tailwindcss/components";inapp.cssto fixTypeError: value.charCodeAt is not a functionClosing, solution to original problem is to install the compatibility build: https://tailwindcss.com/docs/installation#post-css-7-compatibility-build
Try this format fir postcss config:
Instead of going with array format for plugins, use object format. It worked for me in similar use case with nextjs framwork. Might work here too.
Same here. I’m using vue-cli (v3 or v4 both have the error).
TypeError: value.charCodeAt is not a functionUpgrading postcss-loader doesn’t help, It breaks at@tailwind base;, changing that to@import "tailwindcss/base";has no effect. Thanks Tailwind, looking forward to using v2.I had a similar issue. If you are using a postcss-loader you should also update that as well. Seemed to work for me after that.
npm i postcss-loader@latest@tance77 ah ok, thanks for the pointer!
On my setup it seems the problem was due to autoprefixer 10. I had a hint with this article and indeed, downgrading autoprefixer to the latest 9.x (9.8.6) did the trick.
Yes, I tried that. It didn’t help.
This works for me, but after that, I got this error when compiling
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memoryMy setup:
Rails 6 Node v14.9.0 Yarn 1.22.5
tailwind.config.jspostcss.config.js
To compiling, I am using webpacker
./bin/webpack-dev-server --max_old_space_size 4096Any help?
Unrelated to your issue @jbbarth but
@tailwindcss/uihas been implemented intotailwindcssChanges can be found here. https://tailwindui.com/changes-for-v2@Negan1911 That worked for me. After removing the
tailwindcss/uiplugin, I was able to add back@import "~tailwindcss/components";and everything is working fine now. Thanks!It looks like the overall solution is to be sure you’ve removed the
tailwindcss/uiplugin when upgrading to Tailwind 2.0, and this issue can probably be closed.Yes, what @Negan1911 says seems applicable to my case. After resetting everything I didn’t put that plugin back in; and that could very well be the reason it finally worked for me. Thx!
I already wrote that it doesn’t help 😦