romenigld

romenigld

Not found the background images

I installed the Dart Sass and I am trying to put a background image:

html {
  background: url(images/background.svg) no-repeat center center fixed;
  -webkit-background-size: cover;
  -moz-background-size: cover;
  -o-background-size: cover;
}

my assets images has this:

$ tree assets/images
assets/images
├── background.svg
└── cryptos
    ├── btc.svg
    ├── eth.svg
    └── ltc.svg

And when I run the phoenix server I am having this log error:

[info] GET /assets/images/background.svg
[debug] ** (Phoenix.Router.NoRouteError) no route found for GET /assets/images/background.svg (PoeticoinsWeb.Router)
    (poeticoins 0.1.0) lib/phoenix/router.ex:406: PoeticoinsWeb.Router.call/2
    (poeticoins 0.1.0) lib/poeticoins_web/endpoint.ex:1: PoeticoinsWeb.Endpoint.plug_builder_call/2
    (poeticoins 0.1.0) lib/plug/debugger.ex:136: PoeticoinsWeb.Endpoint."call (overridable 3)"/2
    (poeticoins 0.1.0) lib/poeticoins_web/endpoint.ex:1: PoeticoinsWeb.Endpoint.call/2
    (phoenix 1.6.6) lib/phoenix/endpoint/cowboy2_handler.ex:54: Phoenix.Endpoint.Cowboy2Handler.init/4
    (cowboy 2.9.0) /Users/romenigld/workspace/elixir/poeticoding/poeticoins/deps/cowboy/src/cowboy_handler.erl:37: :cowboy_handler.execute/2
    (cowboy 2.9.0) /Users/romenigld/workspace/elixir/poeticoding/poeticoins/deps/cowboy/src/cowboy_stream_h.erl:306: :cowboy_stream_h.execute/3
    (cowboy 2.9.0) /Users/romenigld/workspace/elixir/poeticoding/poeticoins/deps/cowboy/src/cowboy_stream_h.erl:295: :cowboy_stream_h.request_process/3
    (stdlib 3.16.1) proc_lib.erl:226: :proc_lib.init_p_do_apply/3

Compiled css/app.scss to ../priv/static/assets/app.css.
[debug] Live reload: priv/static/assets/app.css
[debug] Live reload: priv/static/assets/app.css

My project on Github

Marked As Solved

LostKobrakai

LostKobrakai

The default phoenix pipeline does no longer copy static assets. You need to put those files into priv/static/…

Also Liked

LostKobrakai

LostKobrakai

You could just not have the files in assets, but maintain them only in priv/static

mcrumm

mcrumm

Phoenix Core Team

Yes– these are the “digested” versions of your static assets. The hashes in the filename represent a specific version of your asset and they are used for cache-busting on the client-side. The ones with the .gz extension are created by the default gzip compressor. Check out the Phoenix.Digestor.Compressor for other compression options.

Yes– assets.deploy is a Mix Task alias defined in your mix.exs that builds and digests assets. Usually you only need to run this task for your production deployment, but running it locally is okay :slight_smile:

If you want to clean up all the digested assets, run the phx.digest.clean task with the --all flag:

$ mix phx.digest.clean --all
romenigld

romenigld

The problem was I downloaded the svg file with curl and I don’t now why it was like HTML code.
I downloaded now the SVG code and it worked.
Thank you"

Where Next?

Popular in Questions Top

chokchit
** (DBConnection.ConnectionError) connection not available and request was dropped from queue after 2733ms. You can configure how long re...
New
_russellb
I want to try my hand at web scraping. What tools/libraries do I need to use. I’m hoping to turn this into something professional so don’...
New
Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New
JeremM34
Hello, how can I check the Phoenix version ? Thanks !
New
beno
I will often find my self writing things similar to: case some_value do nil -> something() "" -> something() _ -> somethi...
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
srinivasu
How to handle excepions in elixir? Suppose i have A, B, C ,D, E modules. and each module has get() function. A.get() method will call t...
New
chensan
I have a User schema with a :from_id field set to type :string: defmodule TweetBot.Repo.Migrations.CreateUsers do use Ecto.Migration ...
New
openscript
Hello! Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New

Other popular topics Top

TunkShif
This post is an instruction guide to help you setup your Neovim for Elixir development from scratch. It includes general information on h...
274 41539 114
New
chrismccord
As promised, the first release candidate of Phoenix 1.3.0 is out! This release focuses on code generators with improved project structure...
New
ovidiubadita
Hey all, I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but afte...
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
fayddelight
I tried installing elixir 1.11.2 erlang 23.3.4 via asdf in my zsh shell. Enabled the versions locally and globally. When I list them ...
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
axelson
This post is a wiki (feel free to hit the edit button near the bottom right of this post to add your own changes!) This post collects co...
239 47930 226
New
openscript
Hello! Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New
dogweather
I wrote this comment on r/haskell, and it’s not popular there. :wink: But I think I’m on to something… Haskell reminds me of Java, and e...
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