tailwindcss: TypeError: getProcessedPlugins is not a function
Describe the problem:
Upgraded from TailwindCSS 1.9.6 to 2.0.1 for my angular project following the instructions on their website. I had previously used the following guide: https://notiz.dev/blog/angular-10-with-tailwindcss#setup to Install the previous version and that worked before.
Please see error below:
ERROR in Module build failed (from ./node_modules/postcss-loader/dist/cjs.js):
TypeError: getProcessedPlugins is not a function
at /home/greg/angular-website/frontend/node_modules/tailwindcss/lib/processTailwindFeatures.js:71:83
at LazyResult.runOnRoot (/home/greg/angular-website/frontend/node_modules/postcss/lib/lazy-result.js:276:16)
at LazyResult.runAsync (/home/greg/angular-website/frontend/node_modules/postcss/lib/lazy-result.js:328:26)
at async Object.loader (/home/greg/angular-website/frontend/node_modules/postcss-loader/dist/index.js:94:14)
ERROR in ./src/styles.scss (./node_modules/css-loader/dist/cjs.js??ref--13-1!./node_modules/@angular-devkit/build-angular/node_modules/postcss-loader/src??embedded!./node_modules/resolve-url-loader??ref--13-3!./node_modules/sass-loader/dist/cjs.js??ref--13-4!./node_modules/postcss-loader/dist/cjs.js??ref--17!./src/styles.scss)
Module build failed (from ./node_modules/postcss-loader/dist/cjs.js):
TypeError: getProcessedPlugins is not a function
at /home/greg/angular-website/frontend/node_modules/tailwindcss/lib/processTailwindFeatures.js:71:83
at LazyResult.runOnRoot (/home/greg/angular-website/frontend/node_modules/postcss/lib/lazy-result.js:276:16)
at LazyResult.runAsync (/home/greg/angular-website/frontend/node_modules/postcss/lib/lazy-result.js:328:26)
at async Object.loader (/home/greg/angular-website/frontend/node_modules/postcss-loader/dist/index.js:94:14)
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 6
- Comments: 81 (4 by maintainers)
Commits related to this issue
- Fix getProcessedPlugins is not a function https://github.com/tailwindlabs/tailwindcss/issues/2810 — committed to w3bdesign/nuxtjs-woocommerce by w3bdesign 4 years ago
- fix tailwind https://github.com/tailwindlabs/tailwindcss/issues/2810 — committed to liaoliaojun/nuxt-apollo-example by liaoliaojun 3 years ago
- Update build-deploy.yml Updating node version to solve issues on build. Ref: https://github.com/tailwindlabs/tailwindcss/issues/2810 — committed to grupohoramasite/siteSourcev3 by ezequieltejada 3 years ago
- tailwind error fix https://github.com/tailwindlabs/tailwindcss/issues/2810 — committed to gtyamamoto/treinamento-vue3-code by gtyamamoto 3 years ago
- Fix getProcessedPlugins is not a function https://github.com/tailwindlabs/tailwindcss/issues/2810 — committed to applesoft1/woocommerceNuxt by applesoft1 4 years ago
@alexcroox I managed to fix it on my end.
What I did was I removed the existing
tailwind.config.jsand just ran the commandnpx tailwindcss init --full, then I just applied the custom configurations that I did to it. I’m going to close the issue since I fixed my original issueCheck your nodejs version (node -v) , I had v10.19.0, then made global update to v14.15.1, using vue-cli with the following dependencies
"dependencies": { "autoprefixer": "^9.8.6", "core-js": "^3.6.5", "postcss": "^7.0.35", "tailwindcss": "npm:@tailwindcss/postcss7-compat@^2.0.1", "vue": "^2.6.11", "vue-router": "^3.4.9" },After updating node and running npm run serve I was able to build the tailwind under vue-cli
postcss.config.js
module.exports = { plugins: [ require('tailwindcss'), require('autoprefixer'), ] }tailwind.config.js
module.exports = { purge: { content: ['./public/**/*.html', './src/**/*.vue'] }, darkMode: false, // or 'media' or 'class' theme: { extend: {}, }, variants: { extend: {}, }, plugins: [], }I too am getting this, I’m using the PostCSS 7 compatibility build with Vue 2
“postcss”: “^7.0.35”, “tailwindcss”: “^2.0.1-compat”
For anyone coming from Google, you need to make sure you have upgraded to Node.js 12.13 or higher for Tailwind v2
I also had this issue. did you follow the upgrade guide?
Specifically, did you upgrade postcss?
npm install tailwindcss@latest postcss@latest autoprefixer@latest@SimonPrague Just spent 20 minutes recreating your project manually, the issue in your config is
presets: []in yourtailwind.config.jsfile. You are telling Tailwind to disable the default config which causes things to blow up when you don’t provide everything it’s expecting manually. We can make this fail more gracefully for sure but this gets your project to build fine:I managed solving the problem like so: https://tailwindcss.com/docs/installation#post-css-7-compatibility-build
Me too! I’m glad it was an easy fix for such a cryptic error 😄
Can someone publish a GitHub repo that reproduces the issue? I suspect it will be fixed by switching to the new compatibility build:
The issue we have been seeing is that
npm install tailwindcss@compatinstalls^2.0.1-compatwhich also matches2.0.1which was causing the wrong version to be installed in some situations.More details here: https://tailwindcss.com/docs/installation#post-css-7-compatibility-build
upgrading node to 14.15.1 as @CreateSean suggested solved my issue
Yep, I followed these instructions. I tried both latest and comp versions. Still the same problem.
These work for me! 👌
In my case this was solved by updating node from 10.22.0 to 14.15.1.
I thought I already did that before but I made a mistake in WSL 2 in Windows when updating it the first time.
This solutions works on my Next.js project! Thanks
Could be Node version too. If you use nvm like me, check if your Node is => 12
Adam, thanks so much! I really appreciate your 20 minutes spending on it. I spent over 5 hours on it and could not figure it out. Anyway thanks a ton. Also love the Tailwind & Tailwind UI!
I had this issue until I updated Node.js from
v10.16.0tov14.15.1.My
package.jsonis:Hopefully this helps anyone who needs the latest version, and doesn’t want to use the compatibility version.
That being said, even the compatibility version didn’t work for me - so I guess just make sure Node.js is up to date (note: not NPM, although make sure that’s up to date too)!
This worked for me. Along with adding a .nvmrc file to change Node to v12
After updating the nodejs version to v14.15.4, my issue is gone
checked and I was on 10.15.3
I then installed NVM (https://github.com/coreybutler/nvm-windows) and added node 14.15.1 and this issue is resolved for me. Though I have other ones now.
It appears the issue is that the tailwindcss package installed under my node_modules (
./node_modules/tailwindcss/node_modules) has thepostcsspackage installed under it at version 7.0.32. I am assuming this serves as an override to my “root” postcss package which is installed at version 8.1.8. Removingnode_modules/tailwindcss/node_modules/postcsssolves the problem and my project now builds.Perhaps someone here understands why tailwindcss is including that older postcss dep into itself and how to permanently fix this? It looks to me like tailwindcss has
"@fullhuman/postcss-purgecss": "^3.0.0"as a dependency and that in turn has a postcss v7 dependency which in turn overrides my global v8.Anyone got Tailwind 2 working with Typescript & Vue Cli & Vue 3, heh?
I’m getting the same
getProcessedPlugins is not a functionerror.postcss 8.1.0 postcss-import 13.0.0 postcss-loader 4.1.0 webpack 5.9.0 tailwindcss 2.0.1 node 14.15.1
postcss config
tailwind config
When I remove tailwind from the postcss plugins, everything compiles fine (CSS is broken of course)
Downgrading to the compat version of tailwind works; however, why should I need to use compat? The docs say if the plugins being used work with postcss 8 then the compat version is unnecessary. The other plugins I’m using work just fine with postcss 8 when tailwind is removed. It’s only when tailwind is added that it breaks.
Thanks for this… I was also tearing my hair out with this one. I generated a default config when upgrading to Tailwind2 and this line was in there. Commenting it out fixed everything. Is there a chance this should be commented out by default when creating a new config? I don’t really know, but wanted to ask the question at least. Thanks again for the help.
Had the same problem, used the compat build (uninstall, then install compat), got this getProcessedPlugins error, then updated node to stable, now I’m getting:
ERROR in ./resources/css/app.css Module build failed (from ./node_modules/css-loader/index.js): ModuleBuildError: Module build failed (from ./node_modules/postcss-loader/src/index.js): TypeError: value.charCodeAt is not a functionThis worked for me as well!
In case someone bumps into this when deploying to Netlify (just when you thought everything was perfect locally…) you can add a .node-version file to your site root and just specify 14 as the version. That makes it build and deploy ok on Netlify.
i solve this issue update to my node version 14
Had the same problem and updated node to stable version: https://medium.com/macoclock/update-your-node-js-on-your-mac-in-2020-948948c1ffb2
Everything worked after that
I don’t know if this is related…
I’m running NextJS I had similar issues for hours (
getProcessedPluginsandtailwindcss/plugins). Following some advice in this thread, I started from a clean config which compiled. I started incrementally adding my config back until I ended up with my old config. But it now works / compiles.It sounds like something is cached somewhere.
Actually that
Is included when run command
npx tailwindcss init --full. And this is from the team, I supposed? Btw the fix worked for me, thank you very muchA problem I had was that I had properties under
variantsthat should have been undervariants.extend. Also, some properties were no longer valid there and had to be moved totheme.extend. Hope that helps someone else.in my case, updating node version to v14.7.0 from v10.22.0 fixed the error in Next.js app. thanks to https://github.com/tailwindlabs/tailwindcss/issues/2810#issuecomment-730657685
solved by upgrading node to LST version
This error went away for me when I switched from node 10 to 12 (fwiw the docs say that node 10 will not work). Hopefully that helps someone.
@adamwathan I’m sorry. I followed all the instructions and it still fails. I tried so many different things (not just everything above) but this is not a solution yet. I think this issue should not yet be closed. Look at me error below from the compat build:
This error shows up about 20 times in a row. And there is also one more error:
This is my tailwind config:
and my tailwind css:
I’m using Vue 3, Vue CLI, TypesCript, PNPM.
Any help greatly appreciated as this currently broke the whole project.
@ThreeScreenStudios thank you! I tried the compat packages early on and it was failing to build still as others have said as well, but I followed your procedure of removing and re-installing and I’m green again. Thank you.
I was able to reproduce the issue by cloning your repo - however I think the issue is that you are not using the compat build of tailwind.
I performed
npm remove tailwindcssandnpm remove postcssfollowed bynpm install tailwindcss@npm:@tailwindcss/postcss7-compatand the project ran after that.Whatever I do, I get a
TypeError: getProcessedPlugins is not a function.Ok I’ve added alias for cool-gray and I’m back to the
TypeError: getProcessedPlugins is not a functionand even with the compat build 😦