React-native-paper: fontFamily "material" is not a system font when using Expo

Created on 23 Sep 2019  路  4Comments  路  Source: callstack/react-native-paper

Environment

Expo SDK 35
react-native-paper 2.16.0

Description

Trying to use react-native-paper components in an expo project, I receive the error "fontFamily "material" is not a system font and has not been loaded through Font.loadAsync.". The docs state that when using expo, there is no need to install vector-icons as it is prepackaged with expo, so I am not sure where the issue lies. I see an open issue for this dating back to earlier this year with no definitive solution but suggesting to load the fonts via await Font.loadAsync({ 'MaterialIcons': require('@expo/vector-icons/fonts/MaterialIcons.ttf') }), but I do not have a fonts directory under vector-icons.

Most helpful comment

I hit a similar issue with Font.loadAsync() after upgrading to Expo SDK 35 (and 34). The fix for me was to:

  1. Delete node_modules folder: rm -rf node_modules
  2. Delete package-lock.json
  3. Run npm install

All 4 comments

I hit a similar issue with Font.loadAsync() after upgrading to Expo SDK 35 (and 34). The fix for me was to:

  1. Delete node_modules folder: rm -rf node_modules
  2. Delete package-lock.json
  3. Run npm install

This was actually the fix for me also, I had forgotten to close this issue. Thanks!

Hi, I am facing the same issue. I tried removing and reinstalling node_modules; however, it did not work for me

Re-opening this issue as of the newest version it still doesn't work with expo.

REACT NATIVE PAPER VERSISON 3.6.0
EXPO SDK 36.0.2

Step I have undertaking:

None of the above seems te work and the material font is used in the internals of react-native-paper

/Users/kevin/Enorm/xclsv-500/node_modules/@expo/vector-icons/build/MaterialIcons.js

import createIconSet from './createIconSet';
import font from './vendor/react-native-vector-icons/Fonts/MaterialIcons.ttf';
import glyphMap from './vendor/react-native-vector-icons/glyphmaps/MaterialIcons.json';
export default createIconSet(glyphMap, 'material', font);
//# sourceMappingURL=MaterialIcons.js.map
Was this page helpful?
0 / 5 - 0 ratings

Related issues

talaikis picture talaikis  路  3Comments

yaronlevi picture yaronlevi  路  3Comments

ButuzGOL picture ButuzGOL  路  4Comments

zxccvvv picture zxccvvv  路  4Comments

timothystewart6 picture timothystewart6  路  4Comments