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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] On upgrading to Expo 40 (from 38): "Unrecognized font family" #11333
Comments
Hey @StartupSam, thanks for providing such a detailed bug report! It's always appreciated when we get a report where the person has taken their time to investigate the issue. Two questions for you:
Cheers, |
Hey @AdamJNavarro ! Yes and yes. Resulted in the same issue for whichever thing wasn't commented out, as far as I could tell. Also tried switching out Rubik for Inter (from the Expo docs) with no luck. Of course, I may have failed to clear some cache or something that made the issue persist, so it's still possible one of those would change something. I doubt it though |
from https://github.com/StartupSam/diagnose-expo-font-loading/blob/master/metro.config.js you should use |
Thanks @brentvatne - to clarify, you're saying I should add @expo/metro-config as a dependency in the project? (or as a dev dependency? It doesn't say on this page) |
either one, it doesn't matter. dev dependencies don't make much sense in most react-native projects because only code that you import in your app is included in the bundle anyways, and you're never going to do |
That did it! Had to change my metro.config.js file though, both the old file and the blank template caused errors. Greatly appreciate the help @brentvatne @AdamJNavarro, a day of debugging would've been multiple days without your responses. For future bug-killers, here are the steps I took to fix:
The config file I ended up with:
Looks like many different things can cause this problem, so items from my attempted solution list above may also help. |
@StartupSam thank you for sharing. works for me. |
Very good! it is worked for me. Thank you. |
I had the same issue when upgraded to Expo 40. My problem was When using SVG elements, make sure to follow the Expo docs instead of react-native-svg-transformer It worked for me. |
same problem on Expo Workflow: bare |
@litinskii - create an issue and fill in the template |
馃悰 Bug Report
Summary of Issue
After upgrading to Expo 40 (from 38 in my case), fonts & icons fail to load.
Environment - output of
expo diagnostics
& the platform(s) you're targetingExpo CLI 4.0.13 environment info:
System:
OS: Linux 5.4 Ubuntu 20.04.1 LTS (Focal Fossa) (reproduced on OSX)
Shell: 5.8 - /usr/bin/zsh
Binaries:
Node: 14.7.0 - ~/.nvm/versions/node/v14.7.0/bin/node
Yarn: 1.22.4 - /usr/bin/yarn
npm: 6.14.7 - ~/.nvm/versions/node/v14.7.0/bin/npm
npmPackages:
expo: ^40.0.0 => 40.0.0
react: 16.13.1 => 16.13.1
react-native: https://github.com/expo/react-native/archive/sdk-40.0.0.tar.gz => 0.63.2
npmGlobalPackages:
expo-cli: 4.0.13
Expo Workflow: managed
Occurs on both iOS and Android.
Reproducible Demo
Not a Snack, but I did tear down the app so it's a single screen with a single text element reproducing the issue. Seen here: https://github.com/StartupSam/diagnose-expo-font-loading
This repo produced the bug on two different machines, on two different phones, each. Just yarn and expo start as you normally would.
Expected Behavior vs Actual Behavior
Expected behavior is the fonts & icons load as they did in Expo 38. With this upgrade to Expo 40, they don't. Android does so silently, while iOS throws an error that says "Unrecognized font family: 'FONTFAMILYNAME'". As far as I can tell, expo-font library is silently failing.
A list of the solutions I've tried so far:
Hopefully I didn't miss anything. Any help is greatly appreciated. :)
The text was updated successfully, but these errors were encountered: