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

PostCSS issue with Tailwind 4.0 #3735

Open
yogeshbabu opened this issue Mar 11, 2025 · 5 comments
Open

PostCSS issue with Tailwind 4.0 #3735

yogeshbabu opened this issue Mar 11, 2025 · 5 comments

Comments

@yogeshbabu
Copy link

Which project does this relate to?

Start

Describe the bug

After recent updates. started getting this error with tailwind 4.0. It was working as expected earlier but now it is throwing error. Only solution i can see is old option of creating postcss config and plugin use. Tailwind has moved on from those.

[plugin:vite:css] [postcss] D:/Work/Dev/projects/tanstack/app/assets/styles/globals.css:10505:15: Unknown word err.plugin

Versions in use
"@tanstack/react-query": "^5.67.2", "@tanstack/react-router": "^1.114.13", "@tanstack/react-router-with-query": "^1.114.13", "@tanstack/react-start": "^1.114.13", "react": "^19.0.0", "react-dom": "^19.0.0", "vinxi": "^0.5.3", "tailwindcss": "^4.0.12", "typescript": "^5.8.2", "vite-tsconfig-paths": "^5.1.4", "@tailwindcss/vite": "^4.0.12", "@tailwindcss/typography": "^0.5.16",

Your Example Website or App

localhost

Steps to Reproduce the Bug or Issue

Build app with latest Tailwind 4.0 and use typography plugin in the global.css

Expected behavior

App should import the global.css without unknown error

Screenshots or Videos

No response

Platform

  • OS: [e.g. Windows, Linux]
  • Browser: [e.g. Chrome, Firefox]

Additional context

No response

@yogeshbabu
Copy link
Author

yogeshbabu commented Mar 11, 2025

Full error just in case. There isn't much to trace back.
[vite] Internal server error: [postcss] D:/Work/Dev/projects/tanstack/app/assets/styles/globals.css:10505:15: Unknown word err.plugin Plugin: vite:css File: D:/Work/Dev/projects/tanstack/app/assets/styles/globals.css:10505:14 at Input.error (D:\Work\Dev\projects\tanstack\node_modules\postcss\lib\input.js:113:16) at Parser.unknownWord (D:\Work\Dev\projects\tanstack\node_modules\postcss\lib\parser.js:595:22) at Parser.other (D:\Work\Dev\projects\tanstack\node_modules\postcss\lib\parser.js:437:12) at Parser.parse (D:\Work\Dev\projects\tanstack\node_modules\postcss\lib\parser.js:472:16) at parse (D:\Work\Dev\projects\tanstack\node_modules\postcss\lib\parse.js:11:12) at new LazyResult (D:\Work\Dev\projects\tanstack\node_modules\postcss\lib\lazy-result.js:165:16) at Processor.process (D:\Work\Dev\projects\tanstack\node_modules\postcss\lib\processor.js:53:14) at compileCSS (file:///D:/Work/Dev/projects/tanstack/node_modules/vite/dist/node/chunks/dep-Cg8OuIew.js:49895:59) at async TransformPluginContext.transform (file:///D:/Work/Dev/projects/tanstack/node_modules/vite/dist/node/chunks/dep-Cg8OuIew.js:49139:11) at async EnvironmentPluginContainer.transform (file:///D:/Work/Dev/projects/tanstack/node_modules/vite/dist/node/chunks/dep-Cg8OuIew.js:48465:18) at async loadAndTransform (file:///D:/Work/Dev/projects/tanstack/node_modules/vite/dist/node/chunks/dep-Cg8OuIew.js:42166:27) (x2)

@radzi00
Copy link

radzi00 commented Mar 11, 2025

Yesterday I've added Tailwind v4 to Nuxt3 app as a plugin, via nuxt.config.ts and main.css file. (so not related to React framework)

When I run:
npm run dev I have the same error as OP.

But the command:
npm run generate makes static files without any issues.

My problem was solved by updating from tailwindcss 4.0.0 to 4.0.12 (but you are on 4.0.12, sorry)

@yogeshbabu
Copy link
Author

yogeshbabu commented Mar 11, 2025

Yeah, today tailwind 4.0.13 released, also tanstack elements released minor updates as well. Still same issue.

Also another thing to note, directly running on Vite does not throw this error. Only while using tanstack-start

@khalwat
Copy link

khalwat commented Mar 12, 2025

I'm also getting this error using Vite 6 + Tailwind CSS 4 -- but I'm not using TanStack, so I think the issue may be with Tailwind CSS and/or Vite rather than being related to TanStack.

vite-1        |   Plugin: vite:css                                                                                                                                                                         
vite-1        |   File: /var/www/project/buildchain/src/css/app.css:2027:14                                                                                                                                
vite-1        |       at Input.error (/var/www/project/buildchain/node_modules/postcss/lib/input.js:113:16)                                                                                                
vite-1        |       at Parser.unknownWord (/var/www/project/buildchain/node_modules/postcss/lib/parser.js:595:22)                                                                                        
vite-1        |       at Parser.other (/var/www/project/buildchain/node_modules/postcss/lib/parser.js:437:12)                                                                                              
vite-1        |       at Parser.parse (/var/www/project/buildchain/node_modules/postcss/lib/parser.js:472:16)                                                                                              
vite-1        |       at parse (/var/www/project/buildchain/node_modules/postcss/lib/parse.js:11:12)                                                                                                       
vite-1        |       at new LazyResult (/var/www/project/buildchain/node_modules/postcss/lib/lazy-result.js:165:16)                                                                                       
vite-1        |       at Processor.process (/var/www/project/buildchain/node_modules/postcss/lib/processor.js:53:14)                                                                                       
vite-1        |       at compileCSS (file:///var/www/project/buildchain/node_modules/vite/dist/node/chunks/dep-glQox-ep.js:49124:59)                                                                       
vite-1        |       at async TransformPluginContext.transform (file:///var/www/project/buildchain/node_modules/vite/dist/node/chunks/dep-glQox-ep.js:48310:11)                                           
vite-1        |       at async EnvironmentPluginContainer.transform (file:///var/www/project/buildchain/node_modules/vite/dist/node/chunks/dep-glQox-ep.js:47636:18)                                       

@yogeshbabu
Copy link
Author

I have another project with Vite 6 + Tailwind 4 without any issues. I use Tanstack router and query in that one and running without this error.

I started testing new Start Framework and it was working fine at the beginning. now with recent updates it started throwing this error. It could be after when tanstack/start became tanstack/react-start. I am yet to test if that is the case

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

3 participants