1
votes

I'm working with expo and snack and keep getting this error

Unable to resolve module 'module://expo-font.js' Evaluating module://expo-font.js Evaluating module://react-native-elements.js ...

I'm not importing any fonts and by tracing the path above, can see that it faults in the 'react-native-elements' module

Here are the dependencies in package.json

"react-native-elements": "0.19.1",
"react-navigation": "1.0.0-beta.27",
"react-native-animatable": "1.3.0",
"react-redux": "5.0.7",
"redux": "4.0.0",
"redux-logger": "3.0.6",
"redux-persist": "5.10.0",
"redux-persist/lib/storage": "5.10.0"

I also do not have access to the App.json file on snack until export

In the past changing the react-native-elements version to something lower hacked it but that doesn't seem to do the job anymore

2
I randomly receive this issue all the time. Unfortunately, I have not been able to resolve the issue through extensive searching. However, If you create a new snack, then copy and paste your code directly into the new snack, your project will work just fine. No need to keep attempting to debug it. EDIT The issue is with when importing React-Native-Elements 0.19.1. I'm not sure why.Lucas Frey

2 Answers

4
votes

I solved it by importing "expo-font"

1
votes

In the Expo interface, I updated package.json I did this and it works.The key is to add "expo-font":"^1.0.0". Behind the scenes it resolves to [email protected].

"dependencies": {
   "@babel/core": "^7.0.0",
   "react-native-elements": "^1.0.0-beta7",
   "expo-font": "^1.0.0",
   "expo-asset": "~1.1.1",
   "expo-file-system": "~1.1.0",
   "expo-constants": "~1.1.0"
}