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

Not working on web, font source is missing uri prop #5

Open
Njaah-0 opened this issue Jul 11, 2020 · 2 comments
Open

Not working on web, font source is missing uri prop #5

Njaah-0 opened this issue Jul 11, 2020 · 2 comments

Comments

@Njaah-0
Copy link

Njaah-0 commented Jul 11, 2020

Hi,
I tried to use this package in pretty fresh project, but run into an issue where nothing happened. My code looks like this:
Screenshot 2020-07-11 at 11 03 22

fontsLoaded stays false and error is always null (but that's another issue). I then did some digging and found out that font source passed to loadAsync looks like this:
Screenshot 2020-07-11 at 11 04 48
But then the FontLoader.web.js in expo-font package expects that object passed to it has property called uri, otherwise invalid source error is thrown.

I modified FontLoader.web.js code like this and it started working, but maybe this package should add this uri prop when user is on web?
Screenshot 2020-07-11 at 11 07 45

@danieloi
Copy link

danieloi commented Apr 19, 2022

Still relevant in 2022.

Thanks so much for sharing

@rodbs
Copy link

rodbs commented Apr 19, 2022

@Njaah-0 Is it necessary to modify the code behind useFonts (FontLoader.web.js) to use it on the web? Could you share your solution or explain what you did a bit further? thx

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