I think this problem might be caused by changes in Prettier v3.0. You can try fixing it by going back to Prettier v2.8.8 with these steps:
npm uninstall prettier prettier-plugin-tailwindcss
npm install -D [email protected] [email protected]
Plugin is incompatible with Prettier v3.0 - github issue
Edit:
As of the prettier-plugin-tailwindcss version 0.5.4, this issue should now be resolved. You can update your dependencies with the following commands:
npm install -D prettier prettier-plugin-tailwindcss
Additionally, don't forget to include the following configuration in your prettier.config.js file:
module.exports = {
plugins: ['prettier-plugin-tailwindcss'],
}
Lastly, make sure to reload Visual Studio Code for the changes to take effect. For more information, please refer to this GitHub comment.
Answer from Artem Purundzhian on Stack OverflowI think this problem might be caused by changes in Prettier v3.0. You can try fixing it by going back to Prettier v2.8.8 with these steps:
npm uninstall prettier prettier-plugin-tailwindcss
npm install -D [email protected] [email protected]
Plugin is incompatible with Prettier v3.0 - github issue
Edit:
As of the prettier-plugin-tailwindcss version 0.5.4, this issue should now be resolved. You can update your dependencies with the following commands:
npm install -D prettier prettier-plugin-tailwindcss
Additionally, don't forget to include the following configuration in your prettier.config.js file:
module.exports = {
plugins: ['prettier-plugin-tailwindcss'],
}
Lastly, make sure to reload Visual Studio Code for the changes to take effect. For more information, please refer to this GitHub comment.
I am using Visual Studio Code Editor:
To begin, install prettier-plugin-tailwindcss as a dev dependency, which it seems you've already done:
npm install -D prettier prettier-plugin-tailwindcss
This command will install the latest versions of both Prettier and the Prettier Tailwind CSS plugin.
Next, you'll need to update your package.json file. Append the following configuration at the end:
"prettier": {
"plugins": [
"prettier-plugin-tailwindcss"
]
}
Ensure your package.json mirrors this structure:

This setup will integrate Tailwind CSS with Prettier in your project.
i am using next js 14 and tailwindcss. How can i use the prettier-plugin-tailwind in this project. Whenever i try to save the file it shows me an error message as
Error while formatting: e:\Web_Dev\Next-Project\next-flowchart\src\components\custom\nodes\round-rectangle.tsx
Error: Cannot find module 'prettier-plugin-tailwindcss'
Require stack:
- c:\Users\PC\.vscode\extensions\numso.prettier-standard-vscode-1.0.2\out\main.js
- c:\Users\PC\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\loader.js
- c:\Users\PC\AppData\Local\Programs\Microsoft VS Code\resources\app\out\bootstrap-amd.js
- c:\Users\PC\AppData\Local\Programs\Microsoft VS Code\resources\app\out\bootstrap-fork.js
i also tried to downgrade the prettier lib, but that didn't work either.
Any suggestions?
Videos
» npm install prettier-plugin-tailwindcss
Hey everyone, I've noticed that I keep setting up projects from scratch, and each time I find myself reading through various documentation. To make things easier, I've compiled all of the relevant information into a gist. Additionally, I've discovered a helpful plugin called prettier-plugin-tailwindcss, which can sort Tailwind classes in a specific order(I've explained everything in the gist),
and it's taken me some time to put it all together. Hopefully, others will find it useful :)
https://gist.github.com/Nivethan-Ar/2375bf451d4c30148916b59c7e0c51c0
Edit: For anyone wondering: The Tailwind Prettier Plugin is not comptible with Prettier v3.0 (https://github.com/tailwindlabs/prettier-plugin-tailwindcss/issues/176). You have to downgrade to v2.8.8
As soon as I add the plugins line to .prettierrc Prettier won't work anymore at all.