What version of astro are you using?
6.2.1 (with bundled vite 7.3.2)
What package manager are you using?
npm
What operating system are you using?
Windows 11 (also seen on macOS — see related vitejs/vite#22322)
Describe the Bug
Running astro add tailwind (the documented way to install Tailwind per the AI tools guide and integration docs) on a fresh Astro 6 project installs @tailwindcss/vite@^4.2.4 and registers it as a Vite plugin. The resulting setup fails to build:
[ERROR] [vite] ✗ Build failed in 1.10s
[@tailwindcss/vite:generate:build] Missing field `tsconfigPaths` on BindingViteResolvePluginConfig.resolveOptions
file: src/styles/global.css
Stack trace:
at makeBuiltinPluginCallable (file:///.../node_modules/rolldown/dist/shared/normalize-string-or-regex-...)
at oxcResolvePlugin (file:///.../node_modules/vite/dist/node/chunks/node.js)
at @tailwindcss/vite/dist/index.mjs
This is the same root cause as vitejs/vite#22322, where the original reporter concluded it is an Astro-side issue rather than Vite. As of the date this is filed, no corresponding issue exists in this repo.
What's the expected result?
astro add tailwind should produce a working setup — either by installing the PostCSS variant (@tailwindcss/postcss) when rolldown-vite is in use, or by warning the user.
What's the actual result?
astro add tailwind succeeds and modifies config, but npm run build then fails immediately on any Tailwind-using stylesheet.
Reproduction
npm create astro@latest demo -- --template minimal --typescript strict --yes
cd demo
npm install
npx astro add tailwind --yes
mkdir -p src/styles
echo '@import "tailwindcss";' > src/styles/global.css
cat > src/pages/index.astro <<'EOA'
---
import "../styles/global.css";
---
<div class="text-blue-500">hi</div>
EOA
npm run build
Workarounds
Option 1 — switch to PostCSS:
npm uninstall @tailwindcss/vite
npm install @tailwindcss/postcss
postcss.config.mjs:
export default { plugins: { "@tailwindcss/postcss": {} } };
astro.config.mjs: remove the @tailwindcss/vite plugin.
This builds fine.
Option 2 — pin Vite to v6 (per miksin/dev-log#34).
Suggested fix
Either:
- Update
astro add tailwind to install @tailwindcss/postcss and write postcss.config.mjs instead of @tailwindcss/vite, until the latter supports the rolldown-bundled Vite that Astro 6 ships with.
- Detect the incompatibility during
astro add tailwind and print a warning + recommendation.
Versions tested
astro@6.2.1
@tailwindcss/vite@4.2.4
tailwindcss@4.2.4
vite@7.3.2 (transitive via Astro)
Related
What version of
astroare you using?6.2.1 (with bundled vite 7.3.2)
What package manager are you using?
npm
What operating system are you using?
Windows 11 (also seen on macOS — see related vitejs/vite#22322)
Describe the Bug
Running
astro add tailwind(the documented way to install Tailwind per the AI tools guide and integration docs) on a fresh Astro 6 project installs@tailwindcss/vite@^4.2.4and registers it as a Vite plugin. The resulting setup fails to build:This is the same root cause as vitejs/vite#22322, where the original reporter concluded it is an Astro-side issue rather than Vite. As of the date this is filed, no corresponding issue exists in this repo.
What's the expected result?
astro add tailwindshould produce a working setup — either by installing the PostCSS variant (@tailwindcss/postcss) when rolldown-vite is in use, or by warning the user.What's the actual result?
astro add tailwindsucceeds and modifies config, butnpm run buildthen fails immediately on any Tailwind-using stylesheet.Reproduction
Workarounds
Option 1 — switch to PostCSS:
postcss.config.mjs:astro.config.mjs: remove the@tailwindcss/viteplugin.This builds fine.
Option 2 — pin Vite to v6 (per miksin/dev-log#34).
Suggested fix
Either:
astro add tailwindto install@tailwindcss/postcssand writepostcss.config.mjsinstead of@tailwindcss/vite, until the latter supports the rolldown-bundled Vite that Astro 6 ships with.astro add tailwindand print a warning + recommendation.Versions tested
astro@6.2.1@tailwindcss/vite@4.2.4tailwindcss@4.2.4vite@7.3.2(transitive via Astro)Related