Skip to content

Running tailwind:build fails silently if .env files are present #114

@trobin91

Description

@trobin91

Hello everyone,

I am stuck on a really weird bug, which might be more linked to the tailwind binary itself.

Since updating to tailwind 4.x.x, I have noticed that running php bin/console tailwind:build fails:

php bin/console tailwind:build -v

 ! [NOTE] Executing Tailwind (pass -v to see more details).                                                             

  Command:
    '/app/var/tailwind/v4.1.12/tailwindcss-linux-x64-musl' '-i' '/app/assets/styles/app.css' '-o' '/app/var/tailwind/app.built.css'

                                                                                                                        
 [ERROR] Tailwind CSS build failed: see output above.       

Even running /app/var/tailwind/v4.1.12/tailwindcss-linux-x64-musl' -h returns 1 without output.

I discovered that the issue came from the presence of a .env or .env.local in the working directory when launching the command.
Running -/tailwind/v4.1.12/tailwindcss-linux-x64-musl' -h in /app/var works, or renaming/moving the .env or .env.local files also work,

Even a clean .env file on a new Symphony project makes it crash.

My setup is php-8.4 on a nginx:alpine base docker image.

Thank you for your help,
Thibault

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