Skip to content

Misleading Manual Binary Placement Instruction in mix tailwind.install Download Error Message #126

@bigscorpions

Description

@bigscorpions

Environment

MacOS m4
Elixir: 1.18.4 (compiled with Erlang/OTP 27)
phoenix: 1.8.rc3
phoenix_tailwind` version: 0.3

Problem

When phoenix_tailwind fails to download the Tailwind CLI binary (e.g., due to network issues), the displayed error message provides ambiguous and potentially misleading instructions for manually placing the binary.

Actual behavior

  1. When a download fails (e.g., for mix assets.setup or mix tailwind.install --if-missing), the error message contains the line:
    Manually download the executable from the URL above and place it inside "_build/tailwind-macos-arm64"
    
  2. This instruction is misleading because:
    • "Place it inside _build/tailwind-macos-arm64" implies _build/tailwind-macos-arm64 is a directory. However, Tailwind.bin_path() refers to the full file path (e.g., _build/tailwind-macos-arm64).
    • The downloaded binary from GitHub is often named tailwindcss-macos-arm64, but the library expects it to be tailwind-macos-arm64 at bin_path(). This renaming isn't mentioned.
  3. Following the literal misleading instruction (or not renaming the file) can lead to the binary not being found or correctly recognized by Tailwind.bin_version(), causing commands to re-attempt download or fail.

Expected behavior

The error message should provide clear and unambiguous instructions for manual binary placement. This includes:

  1. Explicitly stating that the target is a full file path, not a directory.
  2. Clarifying the expected filename (e.g., tailwind-macos-arm64) if it differs from the download name (e.g., tailwindcss-macos-arm64).

Example of desired clarity:
"Manually download the executable from the URL above and place it at the specific path: \"_build/tailwind-#{configured_target()}\" (Note: The downloaded file may need to be renamed to 'tailwind-#{configured_target()}' if it has a 'tailwindcss-' prefix.)"

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