expo: Unrecognized font family on SDK35
🐛 Bug Report
Environment
Expo CLI 3.0.10 environment info: System: OS: macOS 10.14.6 Shell: 5.3 - /bin/zsh Binaries: Node: 8.12.0 - ~/.nvm/versions/node/v8.12.0/bin/node Yarn: 1.17.3 - /usr/local/bin/yarn npm: 6.9.0 - ~/.nvm/versions/node/v8.12.0/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman IDEs: Xcode: 10.3/10G8 - /usr/bin/xcodebuild npmPackages: @storybook/react-native: ^3.4.10 => 3.4.12 expo: ^35.0.0 => 35.0.0 react: 16.8.3 => 16.8.3 react-native: https://github.com/expo/react-native/archive/sdk-35.0.0.tar.gz => 0.59.8 react-navigation: ^4.0.6 => 4.0.6 npmGlobalPackages: expo-cli: 3.0.10
Steps to Reproduce
I just update from SDK34 to SDK35 and got the error, It was working normally before the update, also using expo-font`: 7.0.0.
I’m loading the custom fonts, while loads I return <AppLoading/>, when finish return <App />, I think this is the normal flow, when I move to a screen that uses that font get the error.
On Android is working without problems, the error only shows on iOS
Expected Behavior
The app should run normally
Actual Behavior
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 8
- Comments: 29 (6 by maintainers)
I am having the same issue after upgrading to SDK35.
In my case, it seems the error is arising from trying to use the custom font with
victory-nativefor an SVG chart. When I stop trying to use the font for styling the chart, the error stops – and the font loads fine for the rest of the app. So it possibly has something to do with SVG and custom fonts?@FH-Hersey Any chance you’re trying to use the custom font for styling SVGs, like with
victory-nativeorreact-native-svg?I did the following and it worked. Seems it should be noted on Expo Upgrade Guide
So for me the same issue, if there is Text in the SVG Component. Expo SDK35
I can confirm this.
Same experience here after upgrading to 35.
Also tried the below which doesn’t help.
I did these commands twice and now it’s worked ! 1.- Delete the node_modules folder 2.- Delete the package-lock.json file 3.- Run npm/yarn install
Not sure if this workaround helps anyone, but I found that my issue is because of
react-native-svg. I used aForeignObjectelement with areact-nativeTextelement and it was fine!Originally I got unrecognized font family errors when using the
react-native-svgTextelement to render the fontFamily like this:But it works for me when I do this:
Does it have something to do with this line in withExpoRoot()?
The issue seems to disappear if I comment that line out. I’m not sure if there would be any cascading effects by deleting that step, though.
Any update on this? I’m also using victory-native. For me issue occurred after I upgraded
react-native-svgto 9.9.5.@jmzwar Thanks! Where did you find information on the breaking change to react-native-svg, though? Did you get the issue fixed, or did you also just ‘solve’ it by removing custom fonts for now?
@mortenc I had a similar issue with svg text (appears to be a breaking change in the upgrade to react-native-svg).
Once that was resolved the following was successful.
watchman watch-del-all && rm -rf $TMPDIR/react-* && rm -rf node_modules/ && npm cache verify && npm install && npm run startIs not working on a real device or emulator, @yohamta I tried
expo install expo-assetbut it’s not working (removedyarn.lockandnode_modules) in the process