The @tailwindcss/vite plugin (v4.1.18 or v4.2.1) reads the repo-level .gitignore when deciding which files to skip during source detection. There have been edge cases of which all of them are relevant today. It does not respect:
- Global gitignore (
core.excludesFile / ~/.gitignore_global)
.git/info/exclude
- Per-directory
.gitignore files in parent directories
- Repository root
.gitignore for monorepos if the app is in a workspace.
And has caused the following issues/discussions:
This causes Invalid code point crashes when ignored files (e.g. auto-generated
markdown with hex strings) are scanned and contain sequences that look like CSS hex
escapes.
Reproduce like this
- Add a file to your global gitignore (e.g. ALL_PROMPTS.md in ~/.gitignore_global)
- Place that file in the project with content containing a \ followed by 6+ hex
characters (e.g. \aaec5c)
- Run vite dev — crashes with Invalid code point 11201628
Expected behaviour
File is ignored (git considers it ignored via git check-ignore -v)
Actual
File is scanned.
Tailwind scans the file, interprets \aaec5c as a CSS hex escape, calls String.fromCodePoint(0xaaec5c) which is 11201628 — beyond Unicode max (0x10FFFF), crashing with:
[plugin:@tailwindcss/vite:generate:serve] Invalid code point 11201628, hex sequence overflows `String.fromCodePoint()`
Suggestion
Use git ls-files --others --ignored --exclude-standard or the ignore npm package with all standard gitignore sources, rather than only reading the repo .gitignore.
Workaround available
Option 1
Add @source not "../../SPECIFIC_FILE.md" in globals.css
Option 2
Add the file to the repo-level .gitignore. (does not work for monorepos, then add it to the workspace .gitignore instead.)
Option 3
Or you could just delete the file if you don't need it.
The @tailwindcss/vite plugin (v4.1.18 or v4.2.1) reads the repo-level .gitignore when deciding which files to skip during source detection. There have been edge cases of which all of them are relevant today. It does not respect:
core.excludesFile / ~/.gitignore_global).git/info/exclude.gitignorefiles in parent directories.gitignorefor monorepos if the app is in a workspace.And has caused the following issues/discussions:
This causes Invalid code point crashes when ignored files (e.g. auto-generated
markdown with hex strings) are scanned and contain sequences that look like CSS hex
escapes.
Reproduce like this
characters (e.g. \aaec5c)
Expected behaviour
File is ignored (git considers it ignored via
git check-ignore -v)Actual
File is scanned.
Tailwind scans the file, interprets
\aaec5cas a CSS hex escape, callsString.fromCodePoint(0xaaec5c)which is11201628— beyond Unicode max(0x10FFFF), crashing with:[plugin:@tailwindcss/vite:generate:serve] Invalid code point 11201628, hex sequence overflows `String.fromCodePoint()`Suggestion
Use
git ls-files --others --ignored --exclude-standardor theignorenpm package with all standard gitignore sources, rather than only reading the repo.gitignore.Workaround available
Option 1
Add
@source not "../../SPECIFIC_FILE.md"inglobals.cssOption 2
Add the file to the repo-level .gitignore. (does not work for monorepos, then add it to the workspace
.gitignoreinstead.)Option 3
Or you could just delete the file if you don't need it.