Elixir Getting Started Guide

Thank you Andrew, that helped me :grinning:

I have multiple files in priv/static/ such as favicon.ico (and all the android/apple variants) and some other brand stuff. In my code they are referred to in the usual way. I.e. <link rel="icon" type="image/png" sizes="16x16" href={Routes.static_path(@conn, "/favicon-16x16.png")} />

These files are not being deployed currently. Fly is doing something to the files, as the links in my resulting markup look something like

<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16-118e05e0caa05030e779746a91c5047c.png?vsn=d">

However none of these actually exist, visiting any of the links results in Not Found.

What have I missed / done wrong? :thinking:

I think this is an asset build issue. Fly doesnโ€™t do anything with the files.

You might want to check the file path to you fav icon. For an older project of mine it was like this:

  <link rel="icon" type="image/png" sizes="196x196" href="<%= Routes.static_path(@conn, "/images/favicon-196.png") %>" />

Note the file was in the /images/ folder.

You can try locally compiling the assets and see where the files end up.

Thanks, yes it appears to only affect files directly in /priv/static/.

Listing files directly in endpoint.ex does not fix it. E.g.

plug Plug.Static,
    at: "/",
    from: :rafo,
    gzip: false,
    only:
      ~w(assets images fonts favicon.ico robots.txt favicon-16x16.png)

Iโ€™ve moved all the images into /priv/static/images/ and it works fine.

Thanks again :slight_smile:

1 Like

@andrewbarr Thank you so much! Iโ€™m ignorant about Docker files and so you saved me from frustration and delay.