Skip to content

React native web crashes with react-navigation #1224

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

Closed
mraak opened this issue Jan 10, 2019 · 8 comments
Closed

React native web crashes with react-navigation #1224

mraak opened this issue Jan 10, 2019 · 8 comments

Comments

@mraak
Copy link

mraak commented Jan 10, 2019

The problem

How to reproduce

With "react-navigation": "3.0.9"

simply use createStackNavigator, for example like this:

const App = createStackNavigator({
  TheList: { screen: TheList },
  Detail: { screen: Detail },
  initialRouteName: "TheList"
});

Simplified test case: https://codesandbox.io/s/l9vmp6241m

Steps to reproduce:

  1. Run the app

Actual behavior
Application crashes with the following error

ModuleNotFoundError
Could not find module in path: 'react-native-web/Libraries/Animated/src/AnimatedEvent' relative to '/node_modules/react-native-gesture-handler/Swipeable.js'

Expected behavior
Application does not crash and a navigator is displayed

Environment (include versions). Did this work in previous versions?

  • React Native for Web (version): 0.10.0-alpha.1
  • React (version): 16.5.1
  • Browser: Chrome
@mraak mraak changed the title React native web not working with react-navigation React native web crashes with react-navigation Jan 10, 2019
@necolas
Copy link
Owner

necolas commented Jan 10, 2019

This is an issue for react-navigation and react-native-gesture-handler (reaching into RN internals is not safe). Also the alpha releases are not stable

@necolas necolas closed this as completed Jan 10, 2019
@mraak
Copy link
Author

mraak commented Jan 10, 2019

Thanks for nothing.

@necolas
Copy link
Owner

necolas commented Jan 10, 2019

There's nothing to fix on this side. React Navigation doesn't even support the stack navigator on web yet. https://reactnavigation.org/docs/en/web-support.html

@gut4
Copy link

gut4 commented Jan 10, 2019

@mraak
Copy link
Author

mraak commented Jan 11, 2019

React navigation however works for me in a an Expo project. And having RNW without the commonly used navigators is kinda pointless.

@orestis-z
Copy link

orestis-z commented Feb 5, 2019

Check software-mansion/react-native-gesture-handler#406

And add "react-native-gesture-handler": "jaulz/react-native-gesture-handler#fix/web-compatibility" as temporary dependency in package.json till the PR is merged

RNW runs with navigators on my side now

@AbhishekNairOfficial
Copy link

@zamponotiropita I tried your method, now I ended up with this error:

/react-native-gesture-handler/DrawerLayout.js: Support for the experimental syntax 'exportDefaultFrom' isn't currently enabled (30:8):

@orestis-z
Copy link

@AbhishekNairOfficial that PR is merged in the meantime. Use the npm version

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

5 participants