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

Plugin is attempting to use wrong version of tailwind, causing all formatting to fail #322

Open
martitv opened this issue Oct 2, 2024 · 0 comments

Comments

@martitv
Copy link

martitv commented Oct 2, 2024

What version of Tailwind CSS are you using?

For example: v3.4.13

What build tool (or framework if it abstracts the build tool) are you using?

NextJS v14.2.13

What version of Node.js are you using?

v20.14.0

What browser are you using?

Chrome

What operating system are you using?

Windows

Describe your issue

When I try to format a file in VSCode, I'm getting the following error from prettier:

{
  "filepath": "c:\\MyApp\\src\\page.tsx",
  "parser": "typescript",
  "plugins": [
    "C:\\MyApp\\node_modules\\.pnpm\\[email protected][email protected]\\node_modules\\prettier-plugin-tailwindcss\\dist\\index.mjs"
  ]
}
["ERROR" - 1:06:56 PM] Error formatting document.
["ERROR" - 1:06:56 PM] ENOENT: no such file or directory, open 'C:\MyApp\node_modules\.pnpm\[email protected]\node_modules\tailwindcss\lib\css\preflight.css'
Error: ENOENT: no such file or directory, open 'C:\MyApp\node_modules\.pnpm\[email protected]\node_modules\tailwindcss\lib\css\preflight.css'
    at Object.readFileSync (node:fs:450:20)
    at t.readFileSync (node:electron/js2c/node_init:2:9900)
    at preflight (C:\MyApp\node_modules\.pnpm\[email protected]\node_modules\tailwindcss\lib\corePlugins.js:555:66)
    at registerPlugins (C:\MyApp\node_modules\.pnpm\[email protected]\node_modules\tailwindcss\lib\lib\setupContextUtils.js:815:61)
    at createContext (C:\MyApp\node_modules\.pnpm\[email protected]\node_modules\tailwindcss\lib\lib\setupContextUtils.js:1221:5)
    at eY (file:///C:/MyApp/node_modules/.pnpm/[email protected][email protected]/node_modules/prettier-plugin-tailwindcss/dist/index.mjs:2353:41224)
    at async b2 (file:///C:/MyApp/node_modules/.pnpm/[email protected][email protected]/node_modules/prettier-plugin-tailwindcss/dist/index.mjs:2353:40349)
    at async Object.parse (file:///C:/MyApp/node_modules/.pnpm/[email protected][email protected]/node_modules/prettier-plugin-tailwindcss/dist/index.mjs:2353:48339)
    at async parse4 (file:///C:/MyApp/node_modules/.pnpm/[email protected]/node_modules/prettier/index.mjs:20685:11)
    at async coreFormat (file:///C:/MyApp/node_modules/.pnpm/[email protected]/node_modules/prettier/index.mjs:21146:7)

It looks like the plugin is trying to use a file from tailwind v3.4.11 even though I only have v3.4.13 installed. If I install v3.4.11 and then reinstall v3.4.13 again it works

@thecrypticace thecrypticace transferred this issue from tailwindlabs/tailwindcss Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant