Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fonts fail to load #141

Open
rctneil opened this issue Apr 28, 2020 · 4 comments
Open

Fonts fail to load #141

rctneil opened this issue Apr 28, 2020 · 4 comments

Comments

@rctneil
Copy link

rctneil commented Apr 28, 2020

My code is below but the fonts never load. I just get "Bitter failed to load" showing in the console. Is there any reasons that could make this happen. Any suggestions with how to resolve it?

import FontFaceObserver from 'fontfaceobserver'

document.addEventListener("turbolinks:load", function() {
    let font = new FontFaceObserver('Bitter', {
        weight: 400
    })

    font.load().then(function () {
        console.log('Bitter has loaded.')
    }).catch(function () {
        console.log('Bitter failed to load.')
    })
})
@rctneil
Copy link
Author

rctneil commented Apr 29, 2020

I am using this inside Webpacker. Would this make a difference?

@bramstein
Copy link
Owner

Do you have the @font-face rules in your CSS?

@Lion-El
Copy link

Lion-El commented Nov 28, 2023

Hi bramstien,

@Lion-El
Copy link

Lion-El commented Nov 28, 2023

I am getting the error: Failed to load resource: the server responded with a status of 404 () with the deployed version on github but works fine locally. error points to fontfaceobserver.js:1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants