Skip to content

v4 vite plugin is not compatible with the vite environment API #18002

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

Open
schiller-manuel opened this issue May 13, 2025 · 0 comments
Open

v4 vite plugin is not compatible with the vite environment API #18002

schiller-manuel opened this issue May 13, 2025 · 0 comments
Labels

Comments

@schiller-manuel
Copy link

What version of Tailwind CSS are you using?

"@tailwindcss/vite": "^4.1.6",
"tailwindcss": "^4.1.6",

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

"@tanstack/react-start": "^1.120.4-alpha.6",
"vite": "^6.1.0"

What version of Node.js are you using?

v20.17.0

What browser are you using?

not relevant

What operating system are you using?

macOS

Reproduction URL

yjoer/basic-virtual-file-based@9f291d9

Describe your issue

vite tailwind plugin does not support the new vite environment API yet.
This caused the build to fail in TanStack Start which uses the vite environment:

[@tailwindcss/vite:generate:build] Cannot create proxy with a non-object as target or handler
file: /basic-virtual-file-based/src/styles.css?transform-only

The reason for this build failure is that the fallback that vite uses when a plugin uses createResolver requires the environment to be called 'ssr' which in TanStack Start's case was not the case.

We renamed the server environment in TanStack Start to ssr to ensure compatibliity: TanStack/router#4167

However, the tailwind vite plugin should eventually support the vite environment API by migrating to createIdResolver
see vitejs/vite#20031

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants