You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
v4.3.1 CLI fails with [Error: Invalid handle] when @source present #20231
While this definitely shouldn't crash, the auto content detection starts from where you run the CLI, which is the root of the project so the src/ folder should already be included.
That said, @source directives are relative to the file they are in, so that means that @source "src/**/*"; is relative to the css/ folder. Therefore css/src/ can't be found and crashes.
I'll keep this open until I fix the crash, but the @source "src/**/*"; can be dropped and it should work as expected.
Thanks for looking into this, Robin. I acknowledge the bug in @source, but as you said, it still should not break the build process. I can confirm version 4.3.1 works without --watch.
C:\Users\ales\code\tw-431>ver && node -v && bun -v
Microsoft Windows [Version 10.0.19045.6456]
v26.3.0
1.4.0
C:\Users\ales\code\tw-431>npm install -D @tailwindcss/cli@^4 && bun css:watch
removed 2 packages, changed 5 packages, and audited 39 packages in 1s
6 packages are looking for funding
run `npm fund`for details
found 0 vulnerabilities
npm warn allow-scripts 1 package has install scripts not yet covered by allowScripts:
npm warn allow-scripts @parcel/[email protected] (install: node-gyp rebuild)
npm warn allow-scripts
npm warn allow-scripts Run `npm approve-scripts --allow-scripts-pending` to review, or `npm approve-scripts <pkg>` to allow.
$ tailwindcss -i ./css/app.css -o ./static/app-dev.css --watch --verbose
≈ tailwindcss v4.3.1
node:internal/modules/run_main:107
triggerUncaughtException(
^
[Error: Invalid handle]
Node.js v26.3.0
error: script "css:watch" exited with code 1
C:\Users\ales\code\tw-431>npm install -D @tailwindcss/[email protected]&& bun css:watch
added 2 packages, changed 5 packages, and audited 41 packages in 1s
6 packages are looking for funding
run `npm fund`for details
found 0 vulnerabilities
npm warn allow-scripts 1 package has install scripts not yet covered by allowScripts:
npm warn allow-scripts @parcel/[email protected] (install: node-gyp rebuild)
npm warn allow-scripts
npm warn allow-scripts Run `npm approve-scripts --allow-scripts-pending` to review, or `npm approve-scripts <pkg>` to allow.
$ tailwindcss -i ./css/app.css -o ./static/app-dev.css --watch --verbose
≈ tailwindcss v4.3.0
(node:1572) [DEP0205] DeprecationWarning: `module.register()` is deprecated. Use `module.registerHooks()` instead.(Use `node --trace-deprecation ...` to show where the warning was created)Done in 87ms
Activity
RobinMalfait commentedon Jun 13, 2026
While this definitely shouldn't crash, the auto content detection starts from where you run the CLI, which is the root of the project so the
src/folder should already be included.That said,
@sourcedirectives are relative to the file they are in, so that means that@source "src/**/*";is relative to thecss/folder. Thereforecss/src/can't be found and crashes.I'll keep this open until I fix the crash, but the
@source "src/**/*";can be dropped and it should work as expected.RobinMalfait commentedon Jun 13, 2026
Both
bunandnodework fine on my end:alesvaupotic commentedon Jun 13, 2026
Thanks for looking into this, Robin. I acknowledge the bug in
@source, but as you said, it still should not break the build process. I can confirm version 4.3.1 works without--watch.Prevent crash when using `@tailwindcss/cli` using `--watch` on Windows (
RobinMalfait commentedon Jun 15, 2026
Alright, This should be fixed by #20242, and will be available in the next release.
You can already try it by using the insiders build:
CLI:
PostCSS:
Vite:
webpack:
alesvaupotic commentedon Jun 15, 2026
Thanks a lot, that was quick 😃!