diff --git a/CHANGELOG.md b/CHANGELOG.md index 9edab04ed619..b6e8e5b878f8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] -- Nothing yet! +### Fixed + +- Ensure `@tailwindcss/cli` in `--watch` mode doesn't crash on Windows when `@source` points to a directory that doesn't exist ([#20242](https://github.com/tailwindlabs/tailwindcss/pull/20242)) ## [4.3.1] - 2026-06-12 diff --git a/integrations/cli/index.test.ts b/integrations/cli/index.test.ts index 75869ee32bd6..4be12d9a1a48 100644 --- a/integrations/cli/index.test.ts +++ b/integrations/cli/index.test.ts @@ -375,6 +375,35 @@ describe.each([ }, ) + test( + "watch mode with unknown @source paths shouldn't crash on Windows", + { + fs: { + 'package.json': json` + { + "dependencies": { + "tailwindcss": "workspace:^", + "@tailwindcss/cli": "workspace:^" + } + } + `, + 'index.html': html` +
+ `, + 'src/index.css': css` + @import 'tailwindcss'; + @source "unknown-folder/**/*"; + `, + }, + }, + async ({ fs, spawn }) => { + let process = await spawn(`${command} --input src/index.css --output dist/out.css --watch`) + await process.onStderr((m) => m.includes('Done in')) + + await fs.expectFileToContain('dist/out.css', [candidate`underline`]) + }, + ) + test( 'production build (stdin)', { diff --git a/packages/@tailwindcss-cli/src/commands/build/index.ts b/packages/@tailwindcss-cli/src/commands/build/index.ts index 91365763392f..b8b11a6e45d9 100644 --- a/packages/@tailwindcss-cli/src/commands/build/index.ts +++ b/packages/@tailwindcss-cli/src/commands/build/index.ts @@ -272,7 +272,7 @@ export async function handle(args: Result