Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

File paths passed to Tailwind CSS are not escaped

Aperta
#1,034 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
nuxt, tailwindcss, typescript
Ambito
frontend

Direzione di ricerca

Start by tracing how the concrete path pages/[request-id]/index.vue enters Tailwind's content configuration, and compare it with intentionally provided glob patterns. Check the interaction with moduleOptions.experimental?.strictScanContentPaths. Done means utilities used in files with glob-special characters are generated by Tailwind's scan.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug
Environment
  • @nuxtjs/tailwindcss: v6.14.0
  • tailwindcss: v3.4.18
  • nuxt: v3.13.0
Reproduction

No response

Describe the bug

It looks like @nuxtjs/tailwindcss collects page file paths and passes them to Tailwind CSS as content entries (which are treated as glob patterns).
Since these are actual file paths, they should be escaped so they are not interpreted as fast-glob patterns. However, they currently appear to be passed without escaping.

As a result, some files are excluded from Tailwind’s content scanning. For example, the following Nuxt dynamic route file is not scanned:

pages/[request-id]/index.vue

Because Tailwind’s content configuration is interpreted as fast-glob patterns, characters like [] are treated as pattern syntax rather than a literal file path.

Expected behavior

Files under Nuxt’s pages directory should be scanned by Tailwind even if the path contains characters with special meaning in glob patterns (e.g. []).

Actual behavior

Files under dynamic route directories (e.g. pages/[request-id]/...) are excluded from Tailwind’s scan, and utilities used only in those files are not generated.

Additional context
Proposed fix

For content entries that are concrete file paths (as opposed to intentionally provided glob patterns), escape them using fast-glob’s path escaping (e.g. escapePath(...)) before passing them to Tailwind. This ensures paths containing [] are treated as literal file paths.

Tailwind’s docs also mention that content entries are treated as glob patterns:
https://v3.tailwindcss.com/docs/content-configuration#configuring-source-paths

Notes
  • If the module passes other literal file paths (not patterns) to Tailwind besides pages, those may also need escaping.

  • With correct escaping, moduleOptions.experimental?.strictScanContentPaths might become unnecessary.

Logs

Lingua principale
TypeScript
Stelle
1.9k
Fork
193
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di nuxt-modules/tailwindcss

Tutte le issue di nuxt-modules/tailwindcss

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.