Skip to content

0-byte Executable and SmartScreen Error on Windows #115

@Taminoful

Description

@Taminoful

Issue: 0-byte Executable and SmartScreen Error on Windows

Victor from the Symfony Casts team suggested opening this issue for further discussion and possible improvement. I am willing to help implement potential solutions to the issue.

Summary

On Windows systems, running the tailwind:init or tailwind:build command sometimes fails due to potential interference from antivirus software (such as Avast or even Windows Defender). Instead of downloading the expected TailwindCSS executable, the process results in a 0-byte .exe file being created in the var/tailwind/ directory. When the system later attempts to execute this empty file, it triggers the Windows SmartScreen error: "This app can't run on your computer" with an "Access denied" message in the console.

Potential Root Cause

The antivirus software aggressively blocks or quarantines the executable during the download step, without any explicit warning to the user. The downloader ends up creating an empty file (0 bytes), which persists between attempts because the bundle assumes the presence of the file indicates a successful download, and does not re-download or validate its integrity.

Steps to Reproduce

  1. Use Windows 10 (e.g. 22H2 or higher) with active antivirus software (e.g. Windows Defender 1.1.25080.5 or higher).
  2. Install the bundle composer install symfonycasts/tailwind-bundle in a new skeleton project
  3. Attempt to run php bin/console tailwind:init and tailwind:build.
  4. The antivirus potentially silently blocks or breaks the download, resulting in a 0-byte .exe file in var/tailwind/.
  5. Subsequent attempts to run the command throw a SmartScreen error due to executing an empty file.
  6. Disabling or uninstalling the antivirus and deleting the broken file, then retrying, allows the download and execution to succeed.

Temporary Workaround

  • Remove the bundle via composer.
  • Disable antivirus software.
  • Reinstall the bundle.
  • Run tailwind:init and then tailwind:build to download the executable successfully.
  • Re-enable antivirus software.

Suggestions

Since this issue affects multiple users and is related to common antivirus behaviors (false positives on downloaded executables), it may be beneficial to:

  • Add file size or integrity checks such as a hash digest check after download. If the binary is 0 bytes or otherwise invalid, force a re-download and display a clear error. For this the downloadExecutable() needs to be slightly rewritten and use the GitHub API endpoint instead of downloading over the releases page, this should be changed anyway and shouldn't be too much work.
  • Document the issue and workaround in the README or troubleshooting guide, highlighting the need to temporarily disable antivirus or whitelist the binary download location.
  • Investigate whether the download process can be made more robust against antivirus interference, or alert the user more clearly when a corrupted download is detected.

References

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