Skip to content

New Install doesn't work #7742

Closed
Closed
@ArshanKhanifar

Description

@ArshanKhanifar

What happened?

I simply followed all of the instructions on the website while having created a new react native app:

npx react-native@latest init test_rnn
cd test_rnn

then:

yarn add react-native-navigation
npx rnn-link 
pod install --project-directory=ios # this is new! haha! 

then I changed the index.js file:

/**
 * @format
 */

import {Navigation} from 'react-native-navigation';
import {App} from './App';

Navigation.registerComponent('com.myApp.WelcomeScreen', () => App);
Navigation.events().registerAppLaunchedListener(() => {
  Navigation.setRoot({
    root: {
      stack: {
        children: [
          {
            component: {
              name: 'com.myApp.WelcomeScreen',
            },
          },
        ],
      },
    },
  });
});

And I'm getting this error:

 LOG  Running "test_rnn" with {"rootTag":1,"initialProps":{}}
 ERROR  Invariant Violation: "test_rnn" has not been registered. This can happen if:
* Metro (the local dev server) is run from the wrong folder. Check if Metro is running, stop it and restart it in the current project.
* A module failed to load due to an error and `AppRegistry.registerComponent` wasn't called., js engine: hermes
 ERROR  TypeError: Cannot convert undefined value to object, js engine: hermes

What was the expected behaviour?

app to run.

Was it tested on latest react-native-navigation?

  • I have tested this issue on the latest react-native-navigation release and it still reproduces.

Help us reproduce this issue!

I've made a repo for it here.

In what environment did this happen?

React Native Navigation version:
React Native version: "^7.33.3-hotfix.2"
Has Fabric (React Native's new rendering system) enabled: (no)
Node version: v16.13.1
Device model: iPhone14Pro
iOS version: 16.5 (20F66)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions