Skip to content

Upgrade from alpha to v5 break unit test : TypeError: Cannot read property 'split' of undefined #6793

@kopax

Description

@kopax

Current Behavior

I have tried to upgrade from :

| software                       | version |
| ------------------------------ | ------- |
| iOS or Android                 | iOS, Android and web
| @react-navigation/native       | 5.0.0-alpha.22
| @react-navigation/stack         | 5.0.0-alpha.63
| @react-navigation/drawer       | 5.0.0-alpha.41
| react-native-reanimated        | 1.4.0
| react-native-gesture-handler   | 1.5.3
| react-native-safe-area-context | 0.6.2
| react-native-screens           | 2.0.0-alpha.32
| react-native                   | https://github.com/expo/react-native/archive/sdk-36.0.0.tar.gz
| expo                           | SDK36
| node                           | v13.5.0
| npm or yarn                    | 6.13

To

| software                       | version |
| ------------------------------ | ------- |
| iOS or Android                 | iOS, Android and web
| @react-navigation/native       | 5.0.0
| @react-navigation/stack         | 5.0.0
| @react-navigation/drawer       | 5.0.0
| react-native-reanimated        | 1.4.0
| react-native-gesture-handler   | 1.5.3
| react-native-safe-area-context | 0.6.2
| react-native-screens           | 2.0.0-beta.1
| react-native                   | https://github.com/expo/react-native/archive/sdk-36.0.0.tar.gz
| expo                           | SDK36
| node                           | v13.5.0
| npm or yarn                    | 6.13

I have checked the example and thanks. I have upgrade safely all my dependencies to latest except:

I am now trying to upgrade the following:

 @react-navigation/drawer  ^5.0.0-alpha.41          ^5.0.0 
 @react-navigation/native  ^5.0.0-alpha.22          ^5.0.0 
 @react-navigation/stack   ^5.0.0-alpha.63          ^5.0.0 

I have followed all of your recommendations and to be precise:

  • Open the source that used to create NavigationNativeContainer and replace NavigationNativeContainer for NavigationContainer in all the file.
  • Verify that the import line is equal to import { NavigationContainer } from '@react-navigation/native';
  • run expo start -c to clear expo cache and notice that both app start on android and ios.
  • check at my test and they are all failing:
    TypeError: Cannot read property 'split' of undefined

      at Object.<anonymous> (node_modules/@react-navigation/stack/lib/commonjs/views/Stack/CardStack.tsx:42:26)
      at Object.<anonymous> (node_modules/@react-navigation/stack/lib/commonjs/views/Stack/StackView.tsx:8:1)
  • I have also tried to downgrade dependencies to be as in the demo (ex: react-native-safe-area-context to 0.6.2 instead of 0.6.4) and that didn't help, error is in there:

const maybeExpoVersion = global.Expo?.Constants.manifest.sdkVersion.split(

I've decided to stick to alpha version until I get some more info.

Just to confirm the version used:

├─┬ @react-navigation/[email protected]
│ └─┬ @react-navigation/[email protected]
│   └── @react-navigation/[email protected]  deduped
└─┬ @react-navigation/[email protected]
  └── @react-navigation/[email protected] 

Expected Behavior

I expect the upgrade to go smoothly

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