Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: undefined is not an object (evaluating 'route.routeName') #2718

Closed
ihor opened this issue Dec 19, 2017 · 26 comments
Closed

TypeError: undefined is not an object (evaluating 'route.routeName') #2718

ihor opened this issue Dec 19, 2017 · 26 comments

Comments

@ihor
Copy link

ihor commented Dec 19, 2017

Version

Tell us which versions you are using:

  • react-native-router-flux ^4.0.0-beta.24 (v3 is not supported)
  • react-native v0.50.1

Actual behavior

screen shot 2017-12-19 at 10 01 30

The problem is caused by react-navigation v1.0.0-beta.22: TypeError: undefined is not an object (evaluating 'route.routeName')

Can we release a version with the react-navigation version freezed to v1.0.0-beta.21? beta.22 seems to be too buggy, it's having other issues:

@rohitgoyal
Copy link

I got the same issue with this code

export default class Screens extends React.Component {
  render() {
    return <Router>
      <Scene key="root">
        {/* <Scene key="register" component={Register} title="Register"/> */}
        <Scene key="drawer" drawer contentComponent={SideMenu} >
          <Scene key="main">
            <Scene key="home" component={Home} hideNavBar={true}/>
          </Scene>
        </Scene>
      </Scene>
    </Router>
  }
}

@Anandks1993
Copy link

Anandks1993 commented Dec 19, 2017

I getting the same issue with the following code

              <Router
                titleStyle={{ color: '#FFFFFF' }}
                navigationBarStyle={{
                    backgroundColor: '#2FA5FF',
                }}
                sceneStyle={{ backgroundColor: '#F5FCFF' }}
                backAndroidHandler={this.onBackPress}>
                <Scene key="root">
                    <Drawer
                        title="Menu Options"
                        key="drawer"
                        contentComponent={DrawerContent}
                        drawerWidth={250}
                        drawerImage={MenuButton}
                    >
                        <Scene
                            headerTintColor="#FFFFFF"
                            key="Home"
                            initial
                            title="Home"
                            component={Home} />
                        <Scene
                            headerTintColor="#FFFFFF"
                            key="pairedDevices"
                            title="Paired Devices"
                            component={PairedDevices} />
                        <Scene
                            headerTintColor="#FFFFFF"
                            key="chart"
                            title="Chart"
                            component={TimeSeriesLineChartScreen} />
                        <Scene
                            headerTintColor="#FFFFFF"
                            key="blemanager"
                            title="BLE Manager"
                            component={BLEManager} />
                    </Drawer>
                </Scene>
            </Router>

But it was working 2 hours before, I installed react-navigation and then I uninstalled immediately, After that I was stuck with this issue.

@Shariaty
Copy link

I have the same issue here , downgrade to react-navigation v1.0.0-beta.21 solved the problem for now

@Anandks1993
Copy link

Anandks1993 commented Dec 19, 2017

@Shariaty How did you downgrade react-navigation particularly? Because it is installed as dependency for react-native-router-flux right ?

@Shariaty
Copy link

Shariaty commented Dec 19, 2017

@Anandks1993 replace the node_modules with one of my older projects that has the react-navigation beta.21 and router flux "^4.0.0-beta.24", it is a temporary fix.

@Anandks1993
Copy link

Anandks1993 commented Dec 19, 2017

Okay, for me too now it is working after downgrading react-navigation. Thank you

@ghost
Copy link

ghost commented Dec 19, 2017

+1

@aksonov
Copy link
Owner

aksonov commented Dec 19, 2017 via email

@padmanabanSampath
Copy link

@balpi thankyou for referencing, i just did it and worked

@carlosalber24
Copy link

carlosalber24 commented Dec 20, 2017

Running npm install git+https://github.com/aksonov/react-native-router-flux.git#37c6553 should work temporarily for you. It will install react navigation@1.0.0-beta.21 or do it through the package.json as well.

@ghost
Copy link

ghost commented Dec 20, 2017

I have the same issue with this code:-
react-native-router-flux: 4.0.0-beta.22
react-native: 0.49.3

<Router
    backAndroidHandler={() => Actions.pop()}
    sceneStyle={styles.sceneStyle}
  >
    <Scene key="root">
      <Scene
        key="scene1"
        component={Scene1}
        title="Scene 1"
        navigationBarStyle={styles.navigationBarStyle}
        navBarButtonColor={styles.navBarButtonColor}
        titleStyle={styles.titleStyle}
        initial
      />
      <Drawer
        hideNavBar
        key="dashboard"
        drawerImage={Images.menuIcon}
        contentComponent={Navigation}
        drawerWidth={styles.drawerWidth}
      >
        <Scene
          key="dashboard"
          component={Dashboard}
          title={strings.dashboard}
          navigationBarStyle={styles.navigationBarStyle}
          navBarButtonColor={styles.navBarButtonColor}
          titleStyle={styles.titleStyle}
          renderRightButton={renderNotificationButton}
        />
      </Drawer>
    </Scene>
  </Router>

@Anandks1993
Copy link

@shubham81407 Did you check what version of react-navigation is installed ? Now it should work as the version is locked to react-navigation@1.0.0-beta.21.

@ghost
Copy link

ghost commented Dec 20, 2017

@Anandks1993 I have react-navigation@1.0.0-beta.22 version in package-lock.json

@Anandks1993
Copy link

Anandks1993 commented Dec 20, 2017

@shubham81407 Downgrade to react-navigation@1.0.0-beta.21, It will solve the issue.

@ghost
Copy link

ghost commented Dec 20, 2017

@Anandks1993 Can you tell me why this issue is coming in react-navigation@1.0.0-beta.22?
in previous days it's working fine in this version why?

@Anandks1993
Copy link

@shubham81407 I don't know, May be some kind of bug 😐

@ghost
Copy link

ghost commented Dec 20, 2017

@Anandks1993 thanks for the solution.

@gopaldevra
Copy link

Same issue, and the same library is flagged failed on the npm website.

@ihor
Copy link
Author

ihor commented Dec 20, 2017

@shubham81407 react-navigation@1.0.0-beta.22 was released yesterday.

@Shariaty
Copy link

The error still exist when installing a new fresh router-flux or run npm install !!?
how should i install my other packages !!
my other package after installation dose not recognize react-native link command , and it says I should run npm install , after that link works but router flux and my drawer crash.

@ihor
Copy link
Author

ihor commented Dec 21, 2017

@Shariaty did you try to use the following dependency?

"react-native-router-flux": "git+https://github.com/aksonov/react-native-router-flux.git"

@CptFabulouso
Copy link

In my case it was caused by drawer. I found this issue in react-navigation that solved it.
So now my drawer component looks like this

<Drawer 
	key='drawer' 
	contentComponent={NavigationDrawer} 
	drawerWidth = {0.8*Metrics.screenWidth}
	//following props added to fix the issue
	drawerOpenRoute = 'DrawerOpen'
	drawerCloseRoute = 'DrawerClose'
	drawerToggleRoute = 'DrawerToggle'
>

maybe it will help someone

@ducnhat
Copy link

ducnhat commented Dec 28, 2017

@ihor
I found this solution react-navigation/react-navigation#3148 (comment).

@aksonov
Copy link
Owner

aksonov commented Jan 4, 2018

It was breaking change for latest RNav beta.22. Should be fixed with latest RNRF beta.26

@aksonov aksonov closed this as completed Jan 4, 2018
@aksonov
Copy link
Owner

aksonov commented Jun 16, 2018 via email

@mjstelly
Copy link

mjstelly commented Jun 16, 2018

Your reply begs the question: When will 4.x be stabilized for production? Hitting a moving target while trying to get an app to market is risky business.
Also, upgrading to "react-native-router-flux": "4.0.0-beta.32" did not fix the problem.
simulator screen shot - iphone 6 - 2018-06-16 at 08 14 39

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests