I’m trying to load fonts into my Phoenix framework, I keep getting the following error
[debug] ** (Phoenix.Router.NoRouteError) no route found for GET /static/fonts/stack-interface.ttf (MagnifyWeb.Router)
However, I added my fonts folder to
and I have fonts set at my endpoint
at: "/", from: :magnify, gzip: false,
only: ~w(css fonts images js favicon.ico robots.txt)
According to your Plug.Static configuration, your fonts are at
/fonts/stack-interface.ttf, so make sure your template refers to
<%= static_path(@conn, "/fonts/stack-interface.ttf") %>.
To ensure Phoenix finds the fonts, have your frontend build system place the font files in
The fonts are loaded via CSS i.e.
src: url('../static/fonts/stack-interface.eot?33839631#iefix') format('embedded-opentype'),
Also I thought Phoenix or brunch copies all the files to priv folder automatically on build?
I’m also getting the same error for JS files
[debug] ** (Phoenix.Router.NoRouteError) no route found for GET /js/scripts.js
and CSS files, this is very annoying
[debug] ** (Phoenix.Router.NoRouteError) no route found for GET /css/socicon.css (MagnifyWeb.Router)
Then edit your CSS to point to the address I mentioned. And check your
priv/static path to see that it actually contains the files you expect.
This is my assets folder
I’m not sure if the fonts folder should be in static or the outside folder like it is now
Ok got it working thanks for your help, need to have the folder outside and not in static updated the url and added fonts to the priv