Error in Expo (Undefined Promise Rejection)

0

I am developing an APP in react-native with Expo everything was fine until I installed a module that was not compatible, the question is to uninstall it, remove node_modules, and execute npm install , and try to also execute expo reseteando the packager cache but nothing, when I load the app I get those yellow errors.

17:24:44: [Unhandled promise rejection: Error: File '/var/mobile/Containers/Data/Application/98126621-9112-4E90-8841-8B5285A52444/Library/Caches/ExponentExperienceData/%40anonymous%2Ftestapp-d108144b-6d30-4889-a75b-2fcc1a626091/ExponentAsset-5673da52c98bb6cb33ada5aaf649703e.ttf' for font '9BFE629D-F610-42DE-A03A-E34074A10E08-Roboto' doesn't exist]
- node_modules\react-native\Libraries\BatchedBridge\NativeModules.js:121:42 in createErrorFromErrorData
- node_modules\react-native\Libraries\BatchedBridge\NativeModules.js:78:57 in <unknown>
- ... 5 more stack frames from framework internals
17:24:47: [Unhandled promise rejection: Error: File '/var/mobile/Containers/Data/Application/98126621-9112-4E90-8841-8B5285A52444/Library/Caches/ExponentExperienceData/%40anonymous%2Ftestapp-d108144b-6d30-4889-a75b-2fcc1a626091/ExponentAsset-a37b0c01c0baf1888ca812cc0508f6e2.ttf' for font '9BFE629D-F610-42DE-A03A-E34074A10E08-material' doesn't exist]
- node_modules\react-native\Libraries\BatchedBridge\NativeModules.js:121:42 in createErrorFromErrorData
- node_modules\react-native\Libraries\BatchedBridge\NativeModules.js:78:57 in <unknown>
- ... 5 more stack frames from framework internals
17:24:47: [Unhandled promise rejection: Error: File '/var/mobile/Containers/Data/Application/98126621-9112-4E90-8841-8B5285A52444/Library/Caches/ExponentExperienceData/%40anonymous%2Ftestapp-d108144b-6d30-4889-a75b-2fcc1a626091/ExponentAsset-a37b0c01c0baf1888ca812cc0508f6e2.ttf' for font '9BFE629D-F610-42DE-A03A-E34074A10E08-material' doesn't exist]
- node_modules\react-native\Libraries\BatchedBridge\NativeModules.js:121:42 in createErrorFromErrorData
- node_modules\react-native\Libraries\BatchedBridge\NativeModules.js:78:57 in <unknown>
- ... 5 more stack frames from framework internals
17:24:50: [Unhandled promise rejection: Error: File '/var/mobile/Containers/Data/Application/98126621-9112-4E90-8841-8B5285A52444/Library/Caches/ExponentExperienceData/%40anonymous%2Ftestapp-d108144b-6d30-4889-a75b-2fcc1a626091/ExponentAsset-a37b0c01c0baf1888ca812cc0508f6e2.ttf' for font '9BFE629D-F610-42DE-A03A-E34074A10E08-material' doesn't exist]
- node_modules\react-native\Libraries\BatchedBridge\NativeModules.js:121:42 in createErrorFromErrorData
- node_modules\react-native\Libraries\BatchedBridge\NativeModules.js:78:57 in <unknown>
- ... 5 more stack frames from framework internals

This is the code of my App.js

import React from 'react';
import Login from './views/Login/Login.js';
import HomePage from './views/Landing/Landing.js';
import Settings from './views/Settings/Settings.js';
import { View, Button, StatusBar, Text } from 'react-native';
import { AppLoading, Font } from 'expo';
import { COLOR, ThemeContext, getTheme } from 'react-native-material-ui';
import MainHeader from './components/MainHeader/MainHeader.js';
import Styles from './App.scss';
import {createStackNavigator} from 'react-navigation';

const uiTheme = {
  palette: {
    primaryColor: COLOR.green500,
  },
  toolbar: {
    container: {
      height: 50,
    },
  },
};

function cacheFonts(fonts) {
  return Font.loadAsync({
    'Roboto': require('./fonts/Roboto-Regular.ttf'),
  });
}


class Landing extends React.Component {
  state = {
    isReady: false,
  };
  static navigationOptions = { title: 'Inicio', header: null };

  async _loadAssetsAsync() {
  
    const fontAssets = cacheFonts();

    await Promise.all([...fontAssets]);
  }

  render() {
    var self = this;
    setTimeout(function() { self.setState({isReady: true})}, '1000')
    if (this.state.isReady) {
        return (
         <HomePage navigation={this.props.navigation} />
        );
      }else{
        this._loadAssetsAsync();
        return (
          <View style={Styles.loader}>
            <Text h1 style={Styles.text}>Un segundo, la aplicación se esta cargando</Text>
          </View>
        );
      }
    }
}


const App = createStackNavigator({
  Home: { screen: Landing },
  Login: { screen: Login },
  Settings: { screen: Settings }
},{
  initialRouteName: 'Home',
  headerMode: 'screen'
});


export default App;

Basically what I do is wait a few seconds for the sources to load and then run the APP. I do not know what could be happening here.

    
asked by Santiago D'Antuoni 17.08.2018 в 22:29
source

1 answer

0

It may be that when installing this unsupported module you have changed the configuration of your project, leaving linkeados resources (in this case, fonts) that you then deleted and no longer exist.

I recommend you:

  • If you were versioning your code, check the commit where you installed the module and see what change in the file project.pbxproj .
  • If not, do a 9BFE629D-F610-42DE-A03A-E34074A10E08-Roboto search on your entire project to see if you can remove those references manually.
  • answered by 24.08.2018 в 00:39