googlemaps / react-native-navigation-sdk

React Native library (Beta) for bringing Google Navigation SDK to Android and iOS apps using React.
https://www.npmjs.com/package/@googlemaps/react-native-navigation-sdk
Apache License 2.0
37 stars 7 forks source link

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

Open 1forh opened 8 months ago

1forh commented 8 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 8 months ago

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

caio1985 commented 7 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 4 months 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 4 months ago

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

jd-alexander commented 1 month ago

Let me know if adding expo support is something I can work on and I will send in a PR.

I am interesting in two primary contributions.

  1. Adding expo support.
  2. Adding custom markers that can be displayed on a particular route.
EquesMedia commented 1 month ago

Let me know if adding expo support is something I can work on and I will send in a PR.

I am interesting in two primary contributions.

  1. Adding expo support.
  2. Adding custom markers that can be displayed on a particular route.

I am looking forward for expo support. :-)

How would you do it? By creating a config plugin? I am not very familiar with native development, only JS/react, so I'm curious of the process.

caio1985 commented 1 month ago

hi @jd-alexander, thanks for your interest in contributing to the repository. Feel free to submit a PR and we are going to review it.

dazza5000 commented 2 weeks ago

@jd-alexander adding expo support would be awesome

dazza5000 commented 2 weeks ago

I am new to RN, but have created cordova, flutter, and kmp plugins - how do we create an Expo plugin?