'Unhandled JS Exception: Requiring unknown module "9"
So I'm trying to set up the navigation for a log in screen and I've tried relinking dependecies and installing packages all over again and I've only worked on two files. I am working on MacOS and simulating on iOS 13.5.
This is the complete error when trying to simulate.
App.js
import React, { Component } from 'react'
import {
StyleSheet,
View
} from 'react-native'
import Mystack from './navigators/StackNavigator'
export default class App extends Component {
render() {
return (
<NavigationContainer>
<Mystack/>
</NavigationContainer>
)
}}
const styles = StyleSheet.create({
container: {
},
})
and StackNavigator.js
import * as React from 'react';
import { createStackNavigator} from '@react-navigation/stack';
import { NavigationContainer } from '@react-navigation/native';
import LogIn from './src/components/LogIn.js'
import SignUp from './src/components/SignUp.js'
import Dashboard from './src/components/Dashboard.js'
const Stack = createStackNavigator();
function Mystack() {
return(
<Stack.Navigator initialRouteName = "LogIn"
screenOptions = {{
headerTitleAlign: 'center',
HeaderStyle: {
backgroundColor: "#FFF700",
},
headerTintColor: '#FFF',
headerTitleStyle: {
fontWeight: 'bold',
},
}}>
<Stack.Screen name = "LogIn"
component = {LogIn}
options = {{
title: 'LogIn',
headerShown: false
}}/>
<Stack.Screen name = "SignUp"
component = {SignUp}
options = {{
title: 'SignUp',
headerShown: false
}}/>
<Stack.Screen name = "Dashboard"
component = {Dashboard}
options = {{
title: 'Dashboard'
}
}/>
</Stack.Navigator>
)
}
export default Mystack;
Solution 1:[1]
I am not sure is it proper solution or not but restarting package worked for me.
Solution 2:[2]
I'm not sure what Iva is referring with "package" but in my case I restarted the metro server and it worked.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Iva |
| Solution 2 | Hamza Maqsood |
