question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

fails with react-native-windows, cannot read property Direction of undefined

See original GitHub issue

Hello, Excellent work by the team.

Please forgive me if my issue is not clear enough or does not follow the standard. I will provide further information if need be. Thanks in advance.

Here is my problem, I am running into this error message while trying out react-native-windows on a project.

I followed the instructions on the react navigation webiste to get this installed on a bare react native project. All works well for android, but whenever I run npx react-native run-windows on windows, I get the following error message:

TypeError: Cannot read property 'Direction' of undefined

Project dependencies

"react": "16.11.0",
  "react-native": "0.62.0-0",
    "react-native-gesture-handler": "1.6.1",
    "react-native-reanimated": "1.9.0",
    "react-native-rss-parser": "1.4.0",
    "react-native-safe-area-context": "3.0.2",
    "react-native-screens": "2.8.0",
    "react-native-sqlite-2": "3.0.1",
    "react-native-webview": "10.2.3",
    "react-native-windows": "0.62.0-0"

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:18

github_iconTop GitHub Comments

4reactions
exotexotcommented, Feb 16, 2021

Having the same isssue. Its problematic as this package is part of react-navigation. 😦

1reaction
khanzzirfancommented, Sep 24, 2020

The above recommendation works… but still there are few more things to fix. Here is my setup all together.

"dependencies": {
    "@react-native-community/masked-view": "^0.1.10",
    "@react-native-community/netinfo": "5.5.1",
    "@react-native-community/toolbar-android": "^0.1.0-rc.2",   
    "prop-types": "^15.7.2",
    "react": "16.11.0",
    "react-native": "^0.62.0-0",
    "react-native-gesture-handler": "1.3.0",
    "react-native-reanimated": "^1.13.0",
    "react-native-safe-area-context": "^3.1.8",
    "react-native-screens": "^2.11.0",
    "react-native-vector-icons": "^7.1.0",
    "react-native-windows": "^0.62.0-0",
    "react-navigation": "3.5.1"
  },
  • update all four files mentioned above @Hawiie13
  • Also updated react-native-safe-area-view -> index.web.js to index.windows.js.
  • Also remove lines for ToolbarAndroid from react-native-gesture-handler -> GestureComponents.windows.js
Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot read property 'Direction' of undefined, tests only
I just removed and re-added react-native-gesture-handler with yarn, and ran pod install . Again, the app is working, but the tests fail to...
Read more >
Cannot read property "Direction" of undefined - Comma
Solution · Open Xcode and right click Libraries “Add Files to Project” · /node_modules/react-native-gesture-handlers/ios/RNGestureHandler.
Read more >
fails with react-native-windows, cannot read property Direction of ...
Hello, Excellent work by the team. Please forgive me if my issue is not clear enough or does not follow the standard. I...
Read more >
Troubleshooting | React Navigation
Troubleshooting. This section attempts to outline issues that users frequently encounter when first getting accustomed to using React Navigation.
Read more >
typeerror: cannot read properties of undefined (reading 'route')
This type of error usually occurs when you are trying to access a property of an object or variable that is not defined....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found