You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Starting with Tailwind v4.0.0-alpha.24 this plugin errors when given a tailwind.css config file.
$ pnpm exec prettier src/main.jsx src/main.jsx[error] src/main.jsx: /workspaces/prettier-plugin-tailwindcss-issue-270/my-app/tailwind.css:1[error] @import "tailwindcss";[error] ^[error] [error] SyntaxError: Invalid or unexpected token[error] at wrapSafe (node:internal/modules/cjs/loader:1378:20)[error] at Module._compile (node:internal/modules/cjs/loader:1428:41)[error] at Module._extensions..js (node:internal/modules/cjs/loader:1548:10)[error] at Module.load (node:internal/modules/cjs/loader:1288:32)[error] at Module._load (node:internal/modules/cjs/loader:1104:12)[error] at Module.require (node:internal/modules/cjs/loader:1311:19)[error] at require (node:internal/modules/helpers:179:18)[error] at Wr (file:///workspaces/prettier-plugin-tailwindcss-issue-270/node_modules/.pnpm/[email protected][email protected]/node_modules/prettier-plugin-tailwindcss/dist/index.mjs:156:14078)[error] at file:///workspaces/prettier-plugin-tailwindcss-issue-270/node_modules/.pnpm/[email protected][email protected]/node_modules/prettier-plugin-tailwindcss/dist/index.mjs:2353:3939[error] at pJ (file:///workspaces/prettier-plugin-tailwindcss-issue-270/node_modules/.pnpm/[email protected][email protected]/node_modules/prettier-plugin-tailwindcss/dist/index.mjs:2353:3944)
I realize this isn't in the readme though — I'll leave this open as a reminder to update. I also might look into just making tailwindConfig work for this too.
Thanks, that's interesting! Up to and including v4.0.0-alpha.23 I was clearly using the wrong option, but it only started crashing with alpha.24.
Now I've upgraded all Tailwind dependencies and given each monorepo package its own .prettierrc.json with tailwindEntryPoint configured—and not only is everything working again, but it turns out I'm getting much better results in some packages when sorting classes.
Let's call this one user error, then. Glad to have it sorted, thanks for the tip!
What version of
prettier-plugin-tailwindcss
are you using?v0.6.6
What version of Tailwind CSS are you using?
v4.0.0-alpha.24
What version of Node.js are you using?
v20.17.0
What package manager are you using?
pnpm
What operating system are you using?
Ubuntu
Reproduction URL
https://github.com/aaronadamsCA/prettier-plugin-tailwindcss-issue-270/tree/alpha-24-issue/my-app
Describe your issue
Starting with Tailwind
v4.0.0-alpha.24
this plugin errors when given atailwind.css
config file.Easy to reproduce:
.prettierrc.json
tailwind.css
The text was updated successfully, but these errors were encountered: