# Why isn't app.css immediately generated?

**URL:** <https://forum.elixirforum.com/t/why-isnt-app-css-immediately-generated/57100>\
**Category:** Questions\
**Tags:** phoenix, css, tailwind\
**Created:** [July 17, 2023, 9:09am UTC](https://forum.elixirforum.com/t/why-isnt-app-css-immediately-generated/57100 "2023-07-17T09:09:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![chocolatedonut](https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/c/50afbb/32.png) [@chocolatedonut](https://forum.elixirforum.com/u/chocolatedonut)\
**Post date:** [July 17, 2023, 9:09am UTC](https://forum.elixirforum.com/t/why-isnt-app-css-immediately-generated/57100/1 "2023-07-17T09:09:38Z")

</div>

Why isn’t app.css immediately generated in a fresh Phoenix project? The app on localhost looks wonky due to the missing CSS and only after, say, 30 s the app.css gets generated and the error, as well as the UI, resolves. Not 100% reproducible, but i do see this issue often. It also happens when a project is cloned & built on another computer.

Not a big issue, though a bit jarring since one is surprised for a few s as to what’s happening. I can imagine newcomers are surprised even more.

phoenix “1.7.2”  
phoenix\_live\_reload “1.4.1”  
phoenix\_live\_view “0.18.18”  
tailwind “0.2.0”

Relevant console logs:

```elixir
[debug] ** (Phoenix.Router.NoRouteError) no route found for GET /assets/app.css (AWeb.Router)
    (app 0.1.0) lib/phoenix/router.ex:487: AWeb.Router.call/2
    (app 0.1.0) lib/app_web/endpoint.ex:1: AWeb.Endpoint.plug_builder_call/2
    (app 0.1.0) lib/plug/debugger.ex:136: AWeb.Endpoint."call (overridable 3)"/2
    (app 0.1.0) lib/app_web/endpoint.ex:1: AWeb.Endpoint.call/2
    (phoenix 1.7.2) lib/phoenix/endpoint/sync_code_reload_plug.ex:22: Phoenix.Endpoint.SyncCodeReloadPlug.do_call/4
    (plug_cowboy 2.6.1) lib/plug/cowboy/handler.ex:11: Plug.Cowboy.Handler.init/2
    (cowboy 2.9.0) /path/to/project/deps/cowboy/src/cowboy_handler.erl:37: :cowboy_handler.execute/2
    (cowboy 2.9.0) /path/to/project/deps/cowboy/src/cowboy_stream_h.erl:306: :cowboy_stream_h.execute/3
    (cowboy 2.9.0) /path/to/project/deps/cowboy/src/cowboy_stream_h.erl:295: :cowboy_stream_h.request_process/3
    (stdlib 4.0.1) proc_lib.erl:240: :proc_lib.init_p_do_apply/3

Browserslist: caniuse-lite is outdated. Please run:
  npx update-browserslist-db@latest
  Why you should do it regularly: https://github.com/browserslist/update-db#readme

Rebuilding...

Done in 757ms.
[debug] Live reload: priv/static/assets/app.css

```

* * *

Similar existing threads:

> [@Tailwind not generating app.css](https://forum.elixirforum.com/t/tailwind-not-generating-app-css/57044):
>
> Hi, I’m new to Elixir and Phoenix, I just installed the framework following docs instructions [Installation — Phoenix v1.7.7 (hexdocs.pm)](https://hexdocs.pm/phoenix/installation.html#phoenix) [Directory structure — Phoenix v1.7.7 (hexdocs.pm)](https://hexdocs.pm/phoenix/directory_structure.html), but when I run the mix phx.server command, my wellcome to Phoenix page looks like a mess, Tailwind classes have no style, so I checked the console and I’m getting this: $ mix phx.server [info] Running HelloWeb.Endpoint with cowboy 2.10.0 at 127.0.0.1:4000 (http) [info] Access HelloWeb.Endpoint at http://localh…

> [@No route found for GET /assets/app.css (Phoenix 1.7.3)](https://forum.elixirforum.com/t/no-route-found-for-get-assets-app-css-phoenix-1-7-3/56541):
>
> Hello I’m new in Elixir and Phoenix, I installed and started the “hello app” It’s work nicely except at the routing level for the css I get : [debug] \*\* (Phoenix.Router.NoRouteError) no route found for GET /assets/app.css but the path in the scaffold created by phoenix is \*myapp/assets/css/app.css\*

---

<div class="post-metadata">

**Author:** ![hubertlepicki](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/hubertlepicki/32/6822_2.png) [@hubertlepicki](https://forum.elixirforum.com/u/hubertlepicki)\
**Post date:** [July 17, 2023, 10:52am UTC](https://forum.elixirforum.com/t/why-isnt-app-css-immediately-generated/57100/2 "2023-07-17T10:52:35Z")

</div>

I think in default installation it has to download the package for Tailwind as the default scaffold does not include it, and this takes some time.

---

<div class="post-metadata">

**Author:** ![dimitarvp](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/dimitarvp/32/38664_2.png) [@dimitarvp](https://forum.elixirforum.com/u/dimitarvp)\
**Post date:** [July 17, 2023, 11:25am UTC](https://forum.elixirforum.com/t/why-isnt-app-css-immediately-generated/57100/3 "2023-07-17T11:25:42Z")

</div>

Is there any way to download it with a `mix` command?

---

<div class="post-metadata">

**Author:** ![hubertlepicki](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/hubertlepicki/32/6822_2.png) [@hubertlepicki](https://forum.elixirforum.com/u/hubertlepicki)\
**Post date:** [July 17, 2023, 11:43am UTC](https://forum.elixirforum.com/t/why-isnt-app-css-immediately-generated/57100/4 "2023-07-17T11:43:24Z")

</div>

Yes, there appear to be Mix tasks provided by the library Phoenix uses (and created) to wrap up and deliver Tailwind:

[https://github.com/phoenixframework/tailwind](https://github.com/phoenixframework/tailwind)

---

<div class="post-metadata">

**Author:** ![chocolatedonut](https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/c/50afbb/32.png) [@chocolatedonut](https://forum.elixirforum.com/u/chocolatedonut)\
**Post date:** [July 17, 2023, 11:59am UTC](https://forum.elixirforum.com/t/why-isnt-app-css-immediately-generated/57100/5 "2023-07-17T11:59:06Z")

</div>

Thanks. This explains the behaviour: the “tailwind” dependency runs its Mix task in parallel and if the network is a bit flaky, then it can very well finish noticeably later.

So one can serialize it by explicitly front-running the task

```elixir
mix tailwind default --config=tailwind.config.js \
        --input=css/app.css \
        --output=../priv/static/assets/app.css \
&& ...

```
