Skip to content
This repository has been archived by the owner on Jan 25, 2023. It is now read-only.

LFS support for font files #175

Closed
daiyam opened this issue May 28, 2018 · 17 comments
Closed

LFS support for font files #175

daiyam opened this issue May 28, 2018 · 17 comments

Comments

@daiyam
Copy link

daiyam commented May 28, 2018

Hello,

I've been pushing updates on my github repository and have seen that the only not-google font was not displayed by the browser.
In Chrome, I had the error Failed to decode downloaded font

Here was the content of downloaded font (https://monsieur.tech/fonts/Archive.ttf.woff)

version https://git-lfs.github.com/spec/v1
oid sha256:4cb3bb4abca55976ab304152686f7c22cb19511078cb1bb3f6394c1fb59d36dc
size 17552

So I've used netlifyctl to deploy and now, the font is correctly displayed.

After a quick look around the issue seems to be in buildbot-git-config with

[lfs]
	fetchinclude = *.jpg,*.png,*.svg,*.gif,*.pdf,*.mp4

It will be good if you can also add *.eot,*.woff.

Thx
Baptiste

@brycekahle
Copy link
Contributor

@daiyam I just filed an issue internally to allow specifying the include filter via the netlify.toml config file. Would this fix the issue for you?

@daiyam
Copy link
Author

daiyam commented May 29, 2018

@brycekahle Yes, I think so. It's even a better solution. Thx

@daniele-pelagatti
Copy link

Hi @brycekahle , I'm interested in this subject, can you clarify how can I specify this new option you implemented in my netlify.toml ?
Thanks for your time

@brycekahle
Copy link
Contributor

@daniele-pelagatti It hasn't been implemented yet. I will update this ticket when it is available.

@brycekahle
Copy link
Contributor

@daiyam @daniele-pelagatti you can now specify the fetchinclude filter with the environment variable GIT_LFS_FETCH_INCLUDE.

@daiyam
Copy link
Author

daiyam commented Jun 24, 2018

@brycekahle I have setup the build environment variable GIT_LFS_FETCH_INCLUDE with the value *.eot,*.gif,*.jpg,*.pdf,*.png,*.svg,*.woff and I'm still getting the error...
(maybe the fix hasn't been committed?)

@brycekahle
Copy link
Contributor

@daiyam make sure you also specify GIT_LFS_ENABLED=true

@daiyam
Copy link
Author

daiyam commented Jun 24, 2018

@brycekahle yes, I was missing GIT_LFS_ENABLED=true. Now, I can see in the log using git lfs fetchinclude override of: *.eot,*.gif,*.jpg,*.pdf,*.png,*.svg,*.woff. But I'm still getting the error 😢

@brycekahle
Copy link
Contributor

@daiyam You might want to contact support. They can help debug your build.

@polarathene
Copy link

@brycekahle Is this on the netlify docs at all? I only see the boolean env var, not the one for fetch include. In fact I get a single result from google if I query that env var with netlify as a 2nd keyword.

@arthurzenika
Copy link

Am getting a build failure with GIT_LFS_ENABLED=true https://gitlab.com/arthurlogilab/www.logilab.fr/merge_requests/20

The diff for the netlify.toml is here : https://gitlab.com/arthurlogilab/www.logilab.fr/merge_requests/20/diffs?commit_id=dab0283148e51ef630b2b5b8ffc2ee1f15fa136b

I'm getting

10:42:48 AM: git clone git@gitlab.com:arthurlogilab/www.logilab.fr
10:42:49 AM: Preparing Git Reference merge-requests/20/head
10:42:50 AM: Error checking out branch: Downloading images/118k.png (9.4 KB)
Error downloading object: images/118k.png (4ee8d48): Smudge error: Error downloading images/118k.png (4ee8d484ca629a47c29f87ff7057daf624aa99f7853ad38299465781702adf2d): batch request: missing protocol: ""

Errors logged to /opt/build/repo/.git/lfs/logs/20190226T094250.925550906.log
Use `git lfs logs last` to view the log.
error: external filter 'git-lfs filter-process' failed
fatal: images/118k.png: smudge filter lfs failed
10:42:50 AM: Failing build: Failed to prepare repo
10:42:50 AM: failed during stage 'preparing repo': exit status 128
10:42:51 AM: Finished processing build request in 4.042875978s
10:42:51 AM: Shutting down logging, 0 messages pending

talks about lfs, but doesn't seem to run git lfs clone instead of git clone

@daiyam
Copy link
Author

daiyam commented Feb 26, 2019

@arthurlogilab can you try with GIT_LFS_ENABLED = "true" or by adding a GIT_LFS_FETCH_INCLUDE like GIT_LFS_FETCH_INCLUDE = "*.eot,*.gif,*.jpg,*.pdf,*.png,*.svg,*.woff"?

@arthurzenika
Copy link

@daiyam Thanks for your answer. Tried both options, not better. Would it be a "sections" problem ?

@daiyam
Copy link
Author

daiyam commented Feb 26, 2019

@arthurlogilab sorry, I forgot those variables have to be put in their UI under Deploys / Continuous Deployment / Build environment variables...

@arthurzenika
Copy link

@daiyam ok, that fixed it. So the variables can't be used in the netlify.toml ?

@daiyam
Copy link
Author

daiyam commented Feb 26, 2019

@arthurlogilab no, I don't think. I should remove them from my netlify.toml to avoid another mix up...

@johnrichter
Copy link

johnrichter commented Nov 21, 2019

This issue was a godsend for me. I've been tearing my hair out trying to get fonts to load from LFS correctly in Netlify. I documented it all in this community support thread which could be useful for those running into this in the future.

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

No branches or pull requests

6 participants