2
votes

Getting the following error in relation to Expo/vector-icons ever since upgrading to Expo 34.

fontFamily "FontAwesome" is not a system font and has not been loaded through Font.loadAsync.

  • If you intended to use a system font, make sure you typed the name correctly and that it is supported by your device operating system.

  • If this is a custom font, be sure to load it with Font.loadAsync.

I have tried manually loading the font in App.js with

Font.loadAsync({FontAwesome: require("../node_modules/@expo/vector-icons/build/vendor/react-native-vector-icons/Fonts/FontAwesome.ttf")})

but it has no effect. I have updated expo-font to the latest version, cleared node_modules and package-lock, and rebuilt the project.

Any clues?

3

3 Answers

1
votes

Not a fix but a workaround as I had the same problem and couldn't find a solution.

Try changing

import Font from 'expo-font';

to

import {Font} from 'expo';

Edit: Looks like there might be a fix for the issue I was experiencing, try updating to [email protected] and [email protected]

1
votes
  • Delete your package.json.lock
  • Delete your .expo
  • Execute npm i
  • Run your App

and import * as FontAwesome from "@expo/vector-icon";

1
votes

I updated the expo-font package to the version shown in the warnings and it worked for me.