Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when used with Tailwind 3.0.0 #44

Closed
gedzeppelin opened this issue Dec 10, 2021 · 10 comments
Closed

Error when used with Tailwind 3.0.0 #44

gedzeppelin opened this issue Dec 10, 2021 · 10 comments
Assignees
Labels
bug Something isn't working

Comments

@gedzeppelin
Copy link

Describe the bug
The extensions fails when update to Tailwind v3. Both Prettier CLI and ESLint (with prettier plugin) CLI fails with the same error message.

To Reproduce
Steps to reproduce the behavior:

  1. Open any Tailwind project.
  2. Update Tailwind to v3.0.0.
  3. Run prettier.

Stack trace

node:internal/modules/cjs/loader:936
  throw err;
  ^

Error: Cannot find module '/home/gedzeppelin/hdd/Code/TS/portfolio-front/node_modules/tailwindcss/lib/util/processPlugins'
Require stack:
- /home/gedzeppelin/hdd/Code/TS/portfolio-front/node_modules/tailwind-classes-sorter/lib/index.js
- /home/gedzeppelin/hdd/Code/TS/portfolio-front/node_modules/prettier-plugin-tailwind/lib/index.js
- /home/gedzeppelin/hdd/Code/TS/portfolio-front/node_modules/prettier-plugin-tailwind/prettier-plugin-tailwind.js
- /home/gedzeppelin/hdd/Code/TS/portfolio-front/node_modules/prettier/index.js
- /home/gedzeppelin/hdd/Code/TS/portfolio-front/node_modules/prettier/bin-prettier.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:999:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at new TWClassesSorter (/home/gedzeppelin/hdd/Code/TS/portfolio-front/node_modules/tailwind-classes-sorter/lib/index.js:28:31)
    at Object.<anonymous> (/home/gedzeppelin/hdd/Code/TS/portfolio-front/node_modules/prettier-plugin-tailwind/lib/index.js:10:25)
    at Module._compile (node:internal/modules/cjs/loader:1097:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1149:10)
    at Module.load (node:internal/modules/cjs/loader:975:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/home/gedzeppelin/hdd/Code/TS/portfolio-front/node_modules/tailwind-classes-sorter/lib/index.js',
    '/home/gedzeppelin/hdd/Code/TS/portfolio-front/node_modules/prettier-plugin-tailwind/lib/index.js',
    '/home/gedzeppelin/hdd/Code/TS/portfolio-front/node_modules/prettier-plugin-tailwind/prettier-plugin-tailwind.js',
    '/home/gedzeppelin/hdd/Code/TS/portfolio-front/node_modules/prettier/index.js',
    '/home/gedzeppelin/hdd/Code/TS/portfolio-front/node_modules/prettier/bin-prettier.js'
  ]
}

Versions:

  • prettier-plugin-tailwind version: 2.2.12
  • Operating system: Linux 64 bits
  • NPM/Yarn version: Yarn 1.22.17
  • Node.js: v17.1.0
@gedzeppelin gedzeppelin added the bug Something isn't working label Dec 10, 2021
@lobosan
Copy link

lobosan commented Dec 13, 2021

Same issue here, any estimates on the solution?

@Andrey-Bazhanov
Copy link

related to tqwewe/tailwind-classes-sorter#9

@mryechkin
Copy link

Same issue here, any estimates on the solution?

Don't think we'll be seeing one anytime soon, sadly :(

Project is no longer maintained: #46

@kuubson
Copy link

kuubson commented Jan 9, 2022

Same issue here, any estimates on the solution?

Don't think we'll be seeing one anytime soon, sadly :(

Project is no longer maintained: #46

so a temporary solution is to start using an extension Headwind for vscode

@mryechkin
Copy link

FYI - Tailwind now provides an official plugin: https://tailwindcss.com/blog/automatic-class-sorting-with-prettier

@cungminh2710
Copy link

I tried using this plugin after the official announcement. Still no luck with this error

@tqwewe
Copy link
Owner

tqwewe commented Jan 26, 2022

@cungminh2710 this isn't the official tailwindcss prettier plugin. Did you try the one linked above? I think theirs should stay updated with tailwinds versions

@cungminh2710
Copy link

oh somewhere this was linked. regardless thanks @tqwewe for your amazing work

@yannickoo
Copy link

Thanks @tqwewe for putting the effort into this project! 💪 Posting the solution so that the others can easily find it.


⚠️ I'm pretty sure you are using the unofficial plugin prettier-plugin-tailwind instead of prettier-plugin-tailwindcss.

You can easily fix this by executing the following ⬇️

npm uninstall prettier-plugin-tailwind
npm install -D prettier-plugin-tailwindcss

@gedzeppelin
Copy link
Author

@tqwewe thanks!. I think i can close this issue now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

8 participants