tailwind icon indicating copy to clipboard operation
tailwind copied to clipboard

`mix tailwind default` exists with 137

Open JosephShering opened this issue 2 years ago • 10 comments

Command: mix tailwind default

Output: ** (Mix) mix tailwind default exited with 137

Platform: Mac OS X (13-inch, M1, 2020) Memory 16GB

Mix Tailwind Version: {:tailwind, "~> 0.1.5", runtime: Mix.env() == :dev}

Mix Config Setup:

config :tailwind,
  version: "3.0.10",
  default: [
    args: ~w(
      --config=tailwind.config.js
      --input=css/app.css
      --output=../priv/static/assets/app.css
    ),
    cd: Path.expand("../assets", __DIR__)
  ]

JosephShering avatar Apr 28 '22 05:04 JosephShering

Can you try bumping tailwind version to latest? (3.0.24) . I don't have an M1 architecture to test on, so hopefully the latest build will resolve whatever issues you're hitting

chrismccord avatar Apr 28 '22 13:04 chrismccord

This is my new config entry:

config :tailwind,
  version: "3.0.24",
  default: [
    args: ~w(
      --config=tailwind.config.js
      --input=css/app.css
      --output=../priv/static/assets/app.css
    ),
    cd: Path.expand("../assets", __DIR__)
  ]

Commands I ran: mix tailwind.install

This is the output from the command: 11:38:52.064 [debug] Downloading tailwind from https://github.com/tailwindlabs/tailwindcss/releases/download/v3.0.24/tailwindcss-macos-arm64

Then I ran: mix tailwind default

Output: ** (Mix) mix tailwind default exited with 137

Are there any artifacts that I need to delete to ensure tailwind updates properly?

JosephShering avatar Apr 28 '22 17:04 JosephShering

You could try invoking the standalone tailwinds cli directly from your _build dir and seeing if it provides more helpful output:

$ cd assets
$ ../_build/ailwindcss-macos-arm64 --config=tailwind.config.js --input=css/app.css --output=../priv/static/assets/app.css 

chrismccord avatar Apr 28 '22 18:04 chrismccord

I ran: cd assets

Then: ../_build/tailwind-macos-arm64 --config=tailwind.config.js --input=css/app.css --output=../priv/static/assets/app.css

This was the output: [1] 47934 killed ../_build/tailwind-macos-arm64 --config=tailwind.config.js --input=css/app.css

I can fork and maybe take a look since you don't have an M1

JosephShering avatar Apr 28 '22 21:04 JosephShering

@JosephShering same over here on my M1

I managed to fix the problem temporarily by downloading the latest tailwindcss CLI (as described here) and then replacing the (seemingly corrupted) cli Version at ../_build/tailwind-macos-arm64 with the downloaded version

cblock avatar May 06 '22 19:05 cblock

In my case, dropping the _build folder and running mix tailwind.install again helps

qborisb avatar Jun 16 '22 13:06 qborisb

@chrismccord I have found out what is causing this problem: Mac OS seems to be killing the binary after you update the version. This has to do with the signature of binary I think.

Simply deleting the binary inside _build and running mix tailwind.install resolves the problem. I think we should update the install script to first delete the file and then write a new file instead overwriting the current file: https://github.com/phoenixframework/tailwind/blob/b1d487608bc0486995772232c72961042ba15676/lib/tailwind.ex#L220

I can open a PR for this if you agree.

dvic avatar Jul 08 '22 10:07 dvic

@JosephShering It looks like a typo in your issue title. It reads "exists" instead of "exited". can rename the title of this issue to "mix tailwind default exited with 137".

shankardevy avatar Sep 18 '22 05:09 shankardevy

@chrismccord I have found out what is causing this problem: Mac OS seems to be killing the binary after you update the version. This has to do with the signature of binary I think.

Simply deleting the binary inside _build and running mix tailwind.install resolves the problem. I think we should update the install script to first delete the file and then write a new file instead overwriting the current file: https://github.com/phoenixframework/tailwind/blob/b1d487608bc0486995772232c72961042ba15676/lib/tailwind.ex#L220

I can open a PR for this if you agree.

@chrismccord shall I submit a PR or is there some other (better) solution?

dvic avatar Sep 18 '22 10:09 dvic

Just wanted to confirm that deleting _build/tailwind-macos-arm64 and running tailwind.install fixed it.

I was able to reproduce the problem by changing the config :tailwind, version: "..." version number and running tailwind.install again (as dvic said). After a second install of a different version mix tailwind default always exits with 137.

jdewar avatar Sep 21 '22 16:09 jdewar