googlemaps / react-native-navigation-sdk

Apache License 2.0
15 stars 3 forks source link

Error when including NavigationView component in Expo project using expo-router #74

Open 1forh opened 5 months ago

1forh commented 5 months ago

I'm trying to use the NavigationView component in a fresh Expo/React Native project but getting the error below. I've implemented the same code that you have in the example here in a fresh Expo project.

TypeError: Cannot read property 'Commands' of undefined, js engine: hermes 
    at ContextNavigator (http://192.168.1.154:8081/node_modules/expo-router/entry.bundle//&platform=ios&dev=true&hot=false&lazy=true&transform.engine=hermes&transform.bytecode=true&transform.routerRoot=src%2Fapp:155950:24)
    at ExpoRoot (http://192.168.1.154:8081/node_modules/expo-router/entry.bundle//&platform=ios&dev=true&hot=false&lazy=true&transform.engine=hermes&transform.bytecode=true&transform.routerRoot=src%2Fapp:155906:28)
    at App
    at ErrorToastContainer (http://192.168.1.154:8081/node_modules/expo-router/entry.bundle//&platform=ios&dev=true&hot=false&lazy=true&transform.engine=hermes&transform.bytecode=true&transform.routerRoot=src%2Fapp:299144:24)
    at ErrorOverlay
    at withDevTools(ErrorOverlay) (http://192.168.1.154:8081/node_modules/expo-router/entry.bundle//&platform=ios&dev=true&hot=false&lazy=true&transform.engine=hermes&transform.bytecode=true&transform.routerRoot=src%2Fapp:298678:27)
    at RCTView
    at View (http://192.168.1.154:8081/node_modules/expo-router/entry.bundle//&platform=ios&dev=true&hot=false&lazy=true&transform.engine=hermes&transform.bytecode=true&transform.routerRoot=src%2Fapp:40346:43)
    at RCTView
    at View (http://192.168.1.154:8081/node_modules/expo-router/entry.bundle//&platform=ios&dev=true&hot=false&lazy=true&transform.engine=hermes&transform.bytecode=true&transform.routerRoot=src%2Fapp:40346:43)
    at AppContainer (http://192.168.1.154:8081/node_modules/expo-router/entry.bundle//&platform=ios&dev=true&hot=false&lazy=true&transform.engine=hermes&transform.bytecode=true&transform.routerRoot=src%2Fapp:40157:36)
    at main(RootComponent) (http://192.168.1.154:8081/node_modules/expo-router/entry.bundle//&platform=ios&dev=true&hot=false&lazy=true&transform.engine=hermes&transform.bytecode=true&transform.routerRoot=src%2Fapp:123933:28)

When the component is not included on my homepage, the error doesn't exist. Has anyone run into this weird error before?

zbillones-navagis commented 5 months ago

Hi @1forh, currently, using expo is not supported as of the moment. thanks!

caio1985 commented 5 months ago

@1forh feel free to submit a PR to this library with expo support and we will be reviewing that to add it to our main branch. We are happy to take improvements in this open source library. We created this as a starting point for developers with all Nav SDK methods but if you need to support specific frameworks or libraries, we are happy to take PRs.

protolific commented 1 month ago

FYI, ran into this issue as well. It might be worth communicating there is no expo support in the README given React Native setup promotes using Expo: https://reactnative.dev/docs/environment-setup

caio1985 commented 1 month ago

@illuminati1911 can you kindly update the README to include @protolific's feedback above.