I am getting this error when running a React Native project.
I created the project using expo init NewProject and am running to an ios simulator using expo-cli start --tunnel
(which is when I get the error). Not sure what is causing the issue.
Here is my package.json:
{"name": "NewProject","main": "node_modules/expo/AppEntry.js","scripts": {"start": "expo start","android": "expo start --android","ios": "expo start --ios","web": "expo start --web","eject": "expo eject" },"dependencies": {"@apollo/react-hooks": "^4.0.0","@invertase/react-native-apple-authentication": "^2.1.0","@react-native-community/async-storage": "^1.12.1","@react-native-community/google-signin": "^5.0.0","apollo-cache-inmemory": "^1.6.6","apollo-client": "^2.6.10","apollo-link": "^1.2.14","apollo-link-error": "^1.1.13","apollo-link-http": "^1.5.17","apollo-link-rest": "^0.8.0-beta.0","apollo-link-ws": "^1.0.20","apollo-utilities": "^1.3.4","dateformat": "^4.5.1","expo": "~40.0.0","expo-status-bar": "~1.0.3","google-sign-in": "^3.0.3","graphql-anywhere": "^4.2.7","qs": "^6.9.6","react": "16.13.1","react-dom": "16.13.1","react-native": "https://github.com/expo/react-native/archive/sdk-40.0.1.tar.gz","react-native-code-push": "^7.0.0","react-native-fast-image": "^8.3.4","react-native-firebase": "^5.6.0","react-native-flash-message": "^0.1.23","react-native-gifted-chat": "^0.16.3","react-native-image-crop-picker": "^0.36.0","react-native-indicators": "^0.17.0","react-native-material-textfield": "^0.16.1","react-native-modal": "^11.7.0","react-native-modalize": "^2.0.8","react-native-modest-checkbox": "^3.3.0","react-native-pose": "^0.9.1","react-native-responsive-dimensions": "^3.1.1","react-native-splash-screen": "^3.2.0","react-native-storage": "^1.0.1","react-native-super-grid": "^4.1.1","react-native-svg-transformer": "^0.14.3","react-native-web": "~0.13.12","react-navigation": "^4.4.4","react-navigation-animated-switch": "^0.6.4","react-navigation-hooks": "^1.1.0","react-navigation-stack": "^2.10.4","react-navigation-tabs": "^2.11.0","rn-placeholder": "^3.0.3" },"devDependencies": {"@babel/core": "~7.9.0","@types/react": "~16.9.35","@types/react-native": "~0.63.2","babel-plugin-module-resolver": "^3.2.0","typescript": "~4.0.0" },"private": true}
And here is my App.tsx:
import { ApolloProvider, useMutation } from '@apollo/react-hooks';//import { GoogleSignin } from '@react-native-community/google-signin';import React, { useContext, useEffect } from 'react';import { StatusBar, StyleSheet } from 'react-native';import codePush from 'react-native-code-push';import FlashMessage from 'react-native-flash-message';import { SafeAreaView } from 'react-navigation';import Config from './app/config';import { Errors, PollIntervals } from './app/constants';import { AppContext, AppContextProvider } from './app/context';import client from './app/graphql/client';import { MUTATION_LAST_SEEN } from './app/graphql/mutation';import AppNavigator from './app/navigation';import { ThemeStatic, Typography } from './app/theme';import { DynamicStatusBar } from './app/theme/Colors';import { ThemeColors } from './app/types/theme';import { crashlytics } from './app/utils/firebase';import { loadThemeType } from './app/utils/storage';import { computeUnreadMessages } from './app/utils/shared';const { webClientId } = Config;//GoogleSignin.configure({ // webClientId, // forceConsentPrompt: true//});const SafeAreaApp = () => { const { user, theme, themeType, toggleTheme, updateUnreadMessages } = useContext(AppContext); const { barStyle, backgroundColor } = DynamicStatusBar[themeType]; const [updateLastSeen] = useMutation(MUTATION_LAST_SEEN); const initializeTheme = async () => { try { const themeType = await loadThemeType(); toggleTheme(themeType); } catch ({ message }) { crashlytics.recordCustomError(Errors.LOAD_THEME, message); } }; useEffect(() => { initializeTheme(); }, []); useEffect(() => { setInterval(async () => { if (user.id) { try { const { data: { updateLastSeen: { chats } } } = await updateLastSeen({ variables: { userId: user.id } }); const unreadMessages = computeUnreadMessages(chats, user.id); updateUnreadMessages(unreadMessages); } catch ({ message }) { crashlytics.recordCustomError(Errors.UPDATE_LAST_SEEN, message); } } }, PollIntervals.lastSeen); }, [user.id]); return (<SafeAreaView style={styles(theme).container}><StatusBar animated barStyle={barStyle} backgroundColor={backgroundColor} /><AppNavigator /><FlashMessage titleStyle={styles().flashMessageTitle} floating position='bottom' /></SafeAreaView> );};const App = () => { return (<ApolloProvider client={client}><AppContextProvider><SafeAreaApp /></AppContextProvider></ApolloProvider> );};const styles = (theme = {} as ThemeColors) => StyleSheet.create({ container: { flex: 1, backgroundColor: theme.base }, flashMessageTitle: { ...Typography.FontWeights.Light, ...Typography.FontSizes.Body, color: ThemeStatic.white }});const CodepushApp = codePush({ deploymentKey: Config.codepush.production, checkFrequency: codePush.CheckFrequency.ON_APP_START})(App);export default CodepushApp;
I've updated and checked all dependencies and not sure where to look next, or if there is a problem with the set up of my package.json or App.tsx. Anyone have any ideas?