expo / vector-icons

https://icons.expo.fyi
MIT License
650 stars 113 forks source link

Unrecognized font family 'ionicons' - Error in Expo Client on iOS #152

Closed dderrickmatheww closed 3 years ago

dderrickmatheww commented 3 years ago

Hello Expo team,

I've been searching the internet looking for a solution to this issue but I haven't had much success. I recently updated to expo-cli v4.0.13 and updated the expo sdk to 40.0.0. Since the update I'm now seeing an error when I open my application on iOS via the expo client: "Unrecognized font family 'ionicons'" along with many other vector-icon names.

I've check the @expo/vector-icons directory here: https://icons.expo.fyi/ and was able to find many of the icons I'm using. All of my icons now are question marks and I can't seem to get them back. I've removed my node_modules, cleared npm cache, removed .expo/ and the package.json, uninstalled expo-cli. I've tried configuring the settings for the metro in the .config.js file. I've tried loading them with expo-font. Nothing seems to work. The application runs fine without the icons but obviously I would like them to render correctly. Could you guys help me out?

IMG_0446 IMG_0441 IMG_0443 IMG_0442 IMG_0444 IMG_0445

gasolin commented 3 years ago

met the same issue on expo sdk 40

works fine in expo 39

dderrickmatheww commented 3 years ago

@gasolin If I revert to SDK 39, do you know if I have to revert my expo-cli to a specific version as well?

giuvincenzi commented 3 years ago

I've had the same problem. My problem was a configuration in the "metro.config.js" file.

module.exports = {
  resolver: {
    sourceExts: ['jsx', 'js', 'ts', 'tsx'], // remove this
  },
};

After I removed the sourceExts property the problem has been solved.

gasolin commented 3 years ago

Test snack / expo init blank project and @expo/vector-icons works fine.

After apply the metro.config.js config suggest in https://github.com/kristerkari/react-native-svg-transformer/blob/master/README.md#for-react-native-v057-or-newer--expo-sdk-v3100-or-newer

The vector-icons are disappeared

gasolin commented 3 years ago

@dderrickmatheww can always used the latest expo-cli for supported SDK versions

gasolin commented 3 years ago

Change the sourceExts to the same list as app.json fixed this issue

https://github.com/kristerkari/react-native-svg-transformer/issues/116#issue-773455991

brentvatne commented 3 years ago

if you're having this issue, you may have a custom metro config that doesn't modify sourceExts properly or somehow clobbers it. see https://docs.expo.io/guides/customizing-metro/ for a guide on how you should customize metro using @expo/metro-config

amirbhz86 commented 1 year ago

I have a bare react native project that I added expo version 42 I had this issue but I just fixed with bottom changing

import { AppRegistry } from 'react-native';
import App from './App';
import { name as appName } from './app.json';
AppRegistry.registerComponent(appName, () => App);

to this :

import { registerRootComponent } from 'expo'
import App from './App';
registerRootComponent(App)

and I added this to package.json "main" : "index.js"

and It worked after these changing