question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to load fonts (returning 404)

See original GitHub issue

Hi 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:closed
  • Created 6 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
njjcommented, Sep 28, 2017

@shilman Thanks! The solution ended up being:

start-storybook -p 6006 -s ../

1reaction
vanlukecommented, Sep 28, 2017

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot load font files, 404 error - css
I am using two font icons in a project ...
Read more >
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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found