Unable to load fonts (returning 404)
See original GitHub issueHi all, I’ve tried various approaches to getting my fonts to load, all which have failed.
The main application is routed through nginx, so I use the paths related to that i.e. web-2 in the less files for loading the fonts:
I am using the -s flag when running storybook to point at ./assets/
When loading the fonts, the less file looks something like:
@font-face{
font-family:"Avenir-Roman";
src:url("/web-2/assets/fonts/avenir/57bf7902-79ee-4b31-a327-1bbf59a3d155.eot?#iefix");
src:url("/web-2/assets/fonts/avenir/57bf7902-79ee-4b31-a327-1bbf59a3d155.eot?#iefix") format("eot"),url("/web-2/assets/fonts/avenir/b290e775-e0f9-4980-914b-a4c32a5e3e36.woff2") format("woff2"),url("/web-2/assets/fonts/avenir/4b978f72-bb48-46c3-909a-2a8cd2f8819c.woff") format("woff"),url("/web-2/assets/fonts/avenir/9bdf0737-f98c-477a-9365-ffc41b9d1285.ttf") format("truetype"),url("/web-2/assets/fonts/avenir/15281d0d-e3c2-46e1-94db-cb681e00bfaa.svg#15281d0d-e3c2-46e1-94db-cb681e00bfaa") format("svg");
}
The console error I get is something similar to:
http://localhost:6006/web-2/assets/fonts/avenir/d513e15e-8f35-4129-ad05-481815e52625.woff2
Does anyone have any advice on how to get these to load properly?
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
HTTP 404 Not Found Error with .woff or .woff2 Font Files
Failed to load resource: the server responded with a status of 404 (Not Found). Cause. On many server configurations, the WOFF or WOFF2...
Read more >[HELP] Fonts not being found 404 error - even though they' ...
One thing I'm really struggling with is the loading of fonts. I've placed my custom woff files in /resources/assets/fonts and am calling ...
Read more >404 Error while accessing the font files
404 stands for file are not available at the URL you are trying to access it. check your file path and ...
Read more >Font requests returning 404/410 error
The issue is that many images are not loading that actually exist. For example, on the below page. I have an image at...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@shilman Thanks! The solution ended up being:
start-storybook -p 6006 -s ../In my situation the problem was caused by sass loader so i moved font face statements to CSS files and then import this CSS file in sass