Skip to content

Bug: Tailwind CSS Fails to Scan Files Without Git Initialization (git init) #18190

@peixin

Description

@peixin

What version of Tailwind CSS are you using?
v4.1.8 (confirmed unrelated to the issue)

What build tool (or framework if it abstracts the build tool) are you using?
Next.js 14.2.3 / Vite 6.3.5 (confirmed unrelated to the issue)

What version of Node.js are you using?
v22.16.1

What browser are you using?
Chrome / Firefox (confirmed unrelated to the issue)

What operating system are you using?
macOS 15.4.1

Reproduction URL
N/A (confirmed unrelated to the issue)

Describe your issue
When initializing a new project, Tailwind CSS fails to properly scan class names in files if git init hasn't been executed. The generated @layer utilities; remains empty despite containing valid Tailwind classes in the files. The issue is immediately resolved after running git init.

Reproduction Steps (Verified using official tools)

All steps folow the official installation guide: https://tailwindcss.com/docs/installation

Expected Behavior

Tailwind should scan files and generate utilities regardless of Git repository initialization status.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions