Scanner `globs` walks gitignored directories (files pass respects .gitignore, globs pass does not)
I maintainer di solito rispondono entro 1 giorno
@akasakariko ci sta già lavorando.
Dal 2/10/2026.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 58/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- node.js, vite
- Ambito
- performance, tooling
Direzione di ricerca
Start by running the self-contained repro.mjs and comparing the Scanner files and globs passes, then inspect the Scanner API and the oxide-helper.js integration mentioned in the report. Done means computing scanner.globs no longer traverses directories excluded by .gitignore, while the returned globs remain unchanged.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
What version of Tailwind CSS are you using?
@tailwindcss/oxide 4.3.3 (same behaviour in 4.1.14)
What build tool (or framework if it abstracts the build tool) are you using?
@tailwindcss/vite; also reproduced with the JetBrains Tailwind CSS plugin (its oxide-helper.js) and with the Scanner API directly.
What version of Node.js are you using?
v24.18.1
What operating system are you using?
Linux (btrfs)
Reproduction
Self-contained script, no project needed:
// repro.mjs — run: strace -f -e trace=statx,openat -o trace.log node repro.mjs && grep -c 'repo/var/cache' trace.log
import { createRequire } from 'node:module';
import { mkdirSync, writeFileSync } from 'node:fs';
import { execSync } from 'node:child_process';
const require = createRequire(import.meta.url);
const { Scanner } = require('@tailwindcss/oxide');
const root = '/tmp/oxide-repro/repo';
mkdirSync(`${root}/var/cache/profiler/aa`, { recursive: true });
mkdirSync(`${root}/templates`, { recursive: true });
writeFileSync(`${root}/.gitignore`, '/var/\n');
writeFileSync(`${root}/templates/page.html`, '<div class="flex"></div>');
writeFileSync(`${root}/var/cache/profiler/aa/bb1234`, '<div class="grid"></div>');
execSync('git init -q', { cwd: root });
const scanner = new Scanner({ sources: [{ base: root, pattern: '**/*', negated: false }] });
console.log('files:', scanner.files); // correct: only templates/page.html
console.log('globs:', scanner.globs); // correct result, but computing it walks var/
Describe your issue
Auto source detection respects .gitignore when building scanner.files, but computing scanner.globs walks into gitignored directories anyway. The returned globs are correct (the ignored folder is not in them), so the problem is purely the traversal.
From the strace of the script above:
- The
filespass opensvar/, checksvar/.gitignore,var/.ignoreandvar/.git/info/exclude, then stops. That's correct. - The
globspass then opensvar/,var/cache,var/cache/profiler,var/cache/profiler/aaandstats every file inside. No ignore file is consulted on this pass.
With a large ignored directory this is very costly. In our case it was a Symfony var/cache/dev/profiler with ~13M small files:
vite buildhung for 20+ minutes inread_extent_buffer_pages, single-threaded on the main thread while readingglobs.- The JetBrains Tailwind helper kept spinning at 15–25% CPU per process. It always adds
{ base: <project root>, pattern: '**/*' }, so the walk happens whatever the CSS says.
scanner.files alone, on the same real project, returns in well under a second (3,299 files) and never touches the ignored folder.
Workaround
@import "tailwindcss" source(none); plus explicit @source paths avoids the root scan for the build. It doesn't help IDE integrations that hard-code a root source.
Possibly related: #20385 / #20397. That's a different trigger (allow-list .gitignore); here the .gitignore is a plain /var/.
- Lingua principale
- TypeScript
- Stelle
- 97.9k
- Fork
- 8.9k
- Merge medio
- 2g 19h
- PR unite (30g)
- 24
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di tailwindlabs/tailwindcss
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
tailwindlabs/tailwindcss#20491 · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
Source detection ignores `core.excludesFile`, so globally-ignored directories are scanned (reproduction for #19801)Forse già presa @Lukecele l’ha presa 24 giorni fa. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 65/100
tailwindlabs/tailwindcss#20509 ·
I maintainer di solito rispondono entro 1 giorno
-
@tailwindcss/vite: cached Root.compiler pins the build's plugin context, keeping the finished bundle alive (multi-GB RSS in Astro SSG)Forse già presa @lazerg l’ha presa 30 giorni fa. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 68/100
tailwindlabs/tailwindcss#20501 · 4 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Oxide 4.3.3: Windows access violation after scanning in a Node worker and unloading the addonForse già presa @bompus l’ha presa 43 giorni fa. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
tailwindlabs/tailwindcss#20470 ·
I maintainer di solito rispondono entro 1 giorno
-
needs reproduction
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
tailwindlabs/tailwindcss#20464 · 9 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di tailwindlabs/tailwindcss
Issue simili
-
Area/Cloud Needs Triage Type/Bug
Difficoltà 1/5 1-3 ore Idoneità per principianti 86/100
wso2/product-integrator#2847 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
bluesky-social/social-app#12118 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
heygen-com/hyperframes#6021 ·
I maintainer di solito rispondono entro 1 giorno
-
Edit: Tele Posadas HDApertacheck:passed streams:edit
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno