Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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;
like image 262
Javand1019 Avatar asked Jan 31 '26 22:01

Javand1019


1 Answers

I am not sure is it proper solution or not but restarting package (Metro server) worked for me.

like image 189
Iva Avatar answered Feb 02 '26 12:02

Iva



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!