expo: Font.loadAsync not working after sdk 34 update.
Hello, I had an app that loads some custom fonts and it was working properly until I updated to sdk 34. I now get this error:
fontFamily "manrope-regular" is not a system font and has not been loaded through Font.loadAsync.
Here’s my code:
export default function App() {
const [isReady, setIsReady] = useState(false);
const _cacheSplashResourcesAsync = () => {
return Font.loadAsync({
"manrope-regular": require("@assets/fonts/manrope-regular.otf"),
"manrope-medium": require("@assets/fonts/manrope-medium.otf"),
"manrope-light": require("@assets/fonts/manrope-light.otf"),
"manrope-bold": require("@assets/fonts/manrope-bold.otf"),
"manrope-semibold": require("@assets/fonts/manrope-semibold.otf"),
"manrope-extrabold": require("@assets/fonts/manrope-extrabold.otf")
});
};
if (!isReady) {
return (
<AppLoading
startAsync={_cacheSplashResourcesAsync}
onFinish={() => {
setIsReady(true);
}}
autoHideSplash={false}
/>
);
}
return (
<Provider store={store}>
<StatusBar barStyle="light-content" />
<AppContent />
</Provider>
);
}
I don’t think I am doing something wrong because as I said it was working before the update. Did that happen to anybody?
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 1
- Comments: 17 (3 by maintainers)
There was an update to
expo-fontjust recently, due to this issue which seems to be the same as the one most of your are having, so could you try updatingexpo-fontorexpo? (Brent says the specific versions in that issue)Ok I will reopen the issue, it worked for me in a blank project but I can’t seem to find any problem in my old code
Yes. Many times… maybe I have something wrong in my code but it worked before upgrading to SDK 34…
Here my code :
Am I missing something ? Thank you!