onelixir

onelixir

No route found for GET /assets/app.css (Phoenix 1.7.11)

I am in China, so I just try a new Phoenix project with mix phx.new hello,after this I run command mix setup, and the error:

13:48:38.322 [info] Migrations already up
[debug] Downloading tailwind from https://github.com/tailwindlabs/tailwindcss/releases/download/v3.4.0/tailwindcss-macos-x64
** (RuntimeError) Couldn't fetch https://github.com/tailwindlabs/tailwindcss/releases/download/v3.4.0/tailwindcss-macos-x64: {:error, :socket_closed_remotely}

This typically means we cannot reach the source or you are behind a proxy.
You can try again later and, if that does not work, you might:

  1. If behind a proxy, ensure your proxy is configured and that
     your certificates are set via the cacerts_path configuration

  2. Manually download the executable from the URL above and
     place it inside "_build/tailwind-macos-x64"

  3. Install and use Tailwind from npmJS. See our module documentation
     to learn more: https://hexdocs.pm/tailwind

I manually download tailwind-macos-x64, put it under _build dir, but when I start with mix phx.server I get No route found for GET /assets/app.css and the UI all mess.

And then I follow Tailwind — tailwind v0.5.1 change config/config.exs file this part:

config :tailwind,
  version: "3.4.0",
  hi: [
    args: ~w(
      --config=tailwind.config.js
      --input=css/app.css
      --output=../priv/static/assets/app.css
    ),
    cd: Path.expand("../assets", __DIR__)
  ],
  path: "../_build/tailwindcss-macos-x64"

Still not work, anyone can help me?

Marked As Solved

arcanemachine

arcanemachine

Try using this mix command with the proper URL (must be run from the same directory as your project’s mix.exs file):

mix tailwind.install https://somedomain.com/path/to/tailwind/binary

Also Liked

onelixir

onelixir

Thank you so much! I solve this by doing:

  1. Download and put tailwindcss-macos-x64 in some directory
  2. Run npm install -g http-server
  3. In the same directory in step 1, run http-server
  4. In Phoenix project run mix tailwind.install http://127.0.0.1:8080/tailwindcss-macos-x64
  5. Then mix phx.server will work.

Also , i found out that manually put tailwindcss-macos-x64 will also work if I do:

  1. Put tailwind-macos-x64 inside _build, not tailwindcss.., the name was wrong.
  2. Run chmod +x _build/tailwind-macos-x64
  3. Also need to give permission in System Preferences -> Security & Privacy

Where Next?

Popular in Questions Top

hariharasudhan94
lets say i have a sample like a = 20; b = 10; if (a > b) do {:ok, "a"} end if (a < b) do {:ok, b} end if (a == b) do {:ok, "equa...
New
Emily
I have VueJS GUIs with the project generated using Webpack. I have Elixir modules that will need to be used by the VueJS GUIs. I forese...
New
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
myronmarston
The Elixir Typespec docs show the following syntax for keyword lists in typespecs: # ... | [key: type] # keyword lists...
New
fireproofsocks
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? Ecto.Repo — Ecto v3.14.0 has exampl...
New
JulienCorb
I am trying to implement my new.html.eex file to create new posts on my website. new.html.eex: <h1>Create Post</h1> <%= ...
New
aalberti333
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this: ...
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list. ...
New
shijith.k
I am trying to start a new phoenix project with elixir 1.9, but mix phx.new does not work. It says that ** (Mix) The task "phx.new" could...
New

Other popular topics Top

chrismccord
Phoenix 1.4.0 released Phoenix 1.4 is out! This release ships with exciting new features, most notably with HTTP2 support, improved deve...
688 31194 112
New
fireproofsocks
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? Ecto.Repo — Ecto v3.14.0 has exampl...
New
jerry
Good day to you all. I have been struggling to get a query involving like and ilike to work. Can anyone assist me on this, please? pro...
New
Lily
In templates/appointment/index.html.eex: <%= for appointment <- @appointments do %> <tr> <td><%= appoi...
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
boundedvariable
I am going through the kafka architecture. All the features what the kafka is providing are already in Erlang. I would like hear your opi...
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New

We're in Beta

About us Mission Statement