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 Overflow
🌐
Reddit
reddit.com › r/nextjs › prettier plugin tailwind with next js
r/nextjs on Reddit: Prettier plugin tailwind with next js
December 28, 2023 -

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?

Discussions

Prettier plugin not working with vs code and nextjs project
What version of prettier-plugin-tailwindcss are you using? ^0.3.0 What version of Tailwind CSS are you using? 3.3.2 What version of Node.js are you using? 18.12.1 What package manager are you using... More on github.com
🌐 github.com
35
July 7, 2023
Prettier Plugin TailwindCSS isn't working in NextJS
Prettier Plugin TailwindCSS isn't working in NextJS More on github.com
🌐 github.com
2
1
September 17, 2023
I spent over two hours trying to get Prettier to work with prettier-plugin-tailwindcss. Anyone here using it?
Search files prettierrc and tailwind config files on github for sur you ll have the right settings from there More on reddit.com
🌐 r/tailwindcss
16
7
July 7, 2023
I made a gist for setting up Next.js with Tailwindcss and prettier auto class sorting plugin
Hello! First, nice! I'm sure some people will find this helpful. A lot of these tools are standard, but I'm not sure everyone knows about them. Second, the next create-app CLI has the ability to specify a template to create an app. It's the -e/--example option. You can put in a URL to a GitHub repo, and it will pull that repo for all the files. For a lot of my projects, I'll start at the same place, so I made my own template for it. Then you just need to: yarn create next-app -e https://github.com/ethanmick/next-app-starter So I suggest turning this into a repo so people can use it as a template. Much easier than running all the commands. More on reddit.com
🌐 r/nextjs
5
15
February 21, 2023
🌐
Speaktosteve
speaktosteve.github.io › using-tailwind-css-clsx--and-prettier
speaktosteve | Using Tailwind CSS, CLSX and Prettier in a React/Next.js project
October 15, 2024 - This is where the prettier-plugin-tailwindcss plugin for prettier comes in. This article and corresponding reference repo explains how we set up our toolchain ... The setup is simple, create a basic Next.js app -> https://nextjs.org/docs/getting-started/installation
🌐
GitHub
github.com › tailwindlabs › prettier-plugin-tailwindcss › issues › 177
Prettier plugin not working with vs code and nextjs project · Issue #177 · tailwindlabs/prettier-plugin-tailwindcss
July 7, 2023 - I have created a next js project using create-next-app using npm in vs code. I have the prettier extension in vs code and my code is formatting properly (however, the class orders isn't changing).
Author   AyushKoul00
🌐
Medium
medium.com › frontendweb › how-to-use-prettier-plugin-tailwindcss-in-your-next-js-15-project-6c6151dcdd46
How to Use prettier-plugin-tailwindcss in your Next.js 15 project? | by Rajdeep Singh | FrontEnd Web | Medium
June 13, 2025 - Nextjs 15 How to Use prettier-plugin-tailwindcss in your Next.js 15 project? Automatically Sort your Tailwind CSS Classes in Next.js 15 with Prettier Plugin. When we work with Tailwind CSS, the …
🌐
npm
npmjs.com › package › prettier-plugin-tailwindcss
prettier-plugin-tailwindcss - npm
December 1, 2025 - When using Tailwind CSS v4 you must specify your CSS file entry point, which includes your theme, custom utilities, and other Tailwind configuration options. To do this, use the tailwindStylesheet option in your Prettier configuration. Note that ...
      » npm install prettier-plugin-tailwindcss
    
🌐
DEV Community
dev.to › jsdevspace › setup-nextjs-14-project-with-eslint-prettier-tailwind-css-226j
Setup Next.js 14 project with Eslint + Prettier + Tailwind CSS - DEV Community
March 25, 2024 - module.exports = { semi: true, trailingComma: 'all', singleQuote: true, printWidth: 100, tabWidth: 2, plugins: ["prettier-plugin-tailwindcss"], };
Find elsewhere
🌐
GitHub
gist.github.com › XronTrix10 › 587a2b28953ea262799258139859af16
Set up ESlint and Prettier for Next.js with Typescript and TailwindCSS · GitHub
{ "root": true, "env": { "browser": true, "es6": true, "node": true }, "settings": { "react": { "version": "detect" } }, "parser": "@typescript-eslint/parser", "parserOptions": { "project": "./tsconfig.json", "ecmaVersion": 2024, "ecmaFeatures": { "jsx": true, "arrowFunctions": true }, "sourceType": "module" }, "ignorePatterns": ["node_modules", "build", "dist", "public"], "extends": [ "next", "next/core-web-vitals", "eslint:recommended", "plugin:react/recommended", "plugin:jsdoc/recommended", "plugin:tailwindcss/recommended", "plugin:@typescript-eslint/recommended", "prettier" ], "plugins": [
🌐
Medium
medium.com › @ypriyansh998 › setting-up-a-fresh-next-js-13-project-with-eslint-prettier-and-tailwind-css-105ac4fd0d5c
Setting Up a Fresh Next.js 13 Project with ESLint, Prettier, and Tailwind CSS | by Priyansh | Medium
January 24, 2024 - For automatic Tailwind class sorting, install the prettier-plugin-tailwindcss: npm install prettier-plugin-tailwindcss -D · Create a .prettierrc.json file in your project root and add the plugin: JSON · { "trailingComma": "es5", "semi": true, "tabWidth": 2, "singleQuote": true, "jsxSingleQuote": true, "plugins": ["prettier-plugin-tailwindcss"] } Step 7: Scripting for Efficiency ·
🌐
M4xshen
m4xshen.dev › posts › setup-nextjs-with-airbnb-eslint-prettier-typescript-and-tailwindcss
Setup Next.js with Airbnb ESLint, Prettier, TypeScript and Tailwind CSS | Max Shen Dev
September 10, 2023 - "plugins": ["prettier-plugin-tailwindcss"] Now the example config becomes: { "singleQuote": true, "plugins": ["prettier-plugin-tailwindcss"] } If you run Prettier now, the Tailwind CSS classes name will be sorted! ESLint is a tool for identifying and reporting on patterns found in ECMAScript code, with the goal of making code more consistent and avoiding bugs.
🌐
Medium
medium.com › @alldofaiz › automatically-sort-tailwind-css-classes-in-next-js-with-prettier-d1678d8fe7ae
🛠 Automatically Sort Tailwind CSS Classes in Next.js with Prettier | by Alldofaiz | Medium
July 23, 2025 - In this article, I’ll show you how to automatically sort Tailwind CSS classes in your Next.js project using Prettier and the official plugin prettier-plugin-tailwindcss.
🌐
Felixmokross
felixmokross.dev › blog › next-app-typescript-eslint-prettier-tailwind
Setting up a Next.js app with TypeScript, ESLint, Prettier, and ...
January 17, 2022 - Install the Prettier ESLint plugin: $ pnpm add -D eslint-config-prettier · …and add it to .eslintrc.json: { "extends": [ "next/core-web-vitals", + "prettier" ] } Install Tailwind CSS—including its peer dependencies—and initialize it: $ pnpm add -D tailwindcss postcss autoprefixer $ pnpm tailwindcss init -p ·
🌐
Tailwind CSS
tailwindcss.com › blog › automatic-class-sorting-with-prettier
Automatic Class Sorting with Prettier - Tailwind CSS
The plugin will respect your tailwind.config.js file and work with any Tailwind plugins you've installed, but there is no way to change the sort order. Just like with Prettier, we think that the benefits of auto-formatting will quickly outweigh any stylistic preferences you have and that you'll get used to it pretty fast.
🌐
Reddit
reddit.com › r/nextjs › i made a gist for setting up next.js with tailwindcss and prettier auto class sorting plugin
r/nextjs on Reddit: I made a gist for setting up Next.js with Tailwindcss and prettier auto class sorting plugin
February 21, 2023 -

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

🌐
Sandro Maglione
sandromaglione.com › articles › software › create a nextjs project with typescript, eslint, prettier and tailwindcss
Create a NextJs project with Typescript, ESLint, Prettier and TailwindCSS | Sandro Maglione
August 26, 2022 - A .eslintrc file will be created containing some predefined rules from NextJs. You also have a new command in package.json called lint. We can extend the default configuration by installing Prettier: npm install --save-dev prettier eslint-config-prettier eslint-plugin-prettier
🌐
JavaScript in Plain English
javascript.plainenglish.io › integrating-prettier-with-tailwind-css-in-your-next-js-project-98551f8447f6
Integrating Prettier with Tailwind CSS in Your Next.js Project | by Tomas Svojanovsky | JavaScript in Plain English
September 4, 2024 - { "trailingComma": "es5", "semi": true, "tabWidth": 2, "singleQuote": true, "jsxSingleQuote": true, "plugins": ["prettier-plugin-tailwindcss"] } In the package.json, add these two lines to the scripts section. They will help us use npm run format or npm run format:fix to trigger Prettier.
🌐
GitHub
github.com › tailwindlabs › tailwindcss › discussions › 12548
Applying tailwindAttributes to prettier config doesn't help sort in Nextjs [Prettier Plugin] · tailwindlabs/tailwindcss · Discussion #12548
December 7, 2023 - // prettier.config.js module.exports = { tailwindConfig: './tailwind.config.ts', plugins: ['prettier-plugin-tailwindcss'], tailwindAttributes: ['customClass'], }
Author   tailwindlabs