enesozturk / react-native-hold-menu

📱 A performant, easy to use hold to open context menu for React Native powered by Reanimated 🚀
https://enesozturk.github.io/react-native-hold-menu/
MIT License
1.42k stars 95 forks source link

Expo Managed app support #81

Open fabiofcferreira opened 2 years ago

fabiofcferreira commented 2 years ago

Describe the bug Upon following the instructions in this package's README and also the dependencies instructions, I've come up to this error:

TypeError: (0, _expoModulesCore.requireNativeModule) is not a function. (In '(0, _expoModulesCore.requireNativeModule)('ExpoHaptics')', '(0, _expoModulesCore.requireNativeModule)' is undefined)
at node_modules/react-native/Libraries/Core/ExceptionsManager.js:104:6 in reportException
at node_modules/react-native/Libraries/Core/ExceptionsManager.js:172:19 in handleException
at node_modules/react-native/Libraries/Core/setUpErrorHandling.js:24:6 in handleError
at node_modules/@react-native/polyfills/error-guard.js:49:36 in ErrorUtils.reportFatalError
at node_modules/metro-runtime/src/polyfills/require.js:204:6 in guardedLoadModule
at http://192.168.1.100:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&strict=false&minify=false:284752:3 in global code

To Reproduce Steps to reproduce the behavior:

  1. yarn add react-native-hold-menu
  2. npx expo install react-native-reanimated
  3. expo install react-native-gesture-handler
  4. npx expo install expo-blur
  5. npx expo install expo-haptics

Expected behavior Hold menu working

Actual behavior App doesn't run with the following error being displayed: TypeError: (0, _expoModulesCore.requireNativeModule) is not a function. (In '(0, _expoModulesCore.requireNativeModule).

Screenshots image

Package versions

Additional context From my understanding, this could be an issue with expo-modules-core not supporting expo managed apps yet - hence the API documentation for setup not being valid.

However, if that is true this package could have a more clear description of what's going on with the expo compability. It says it's compatible but it's not clear if it supports bare, managed or both types of apps.

enesozturk commented 1 year ago

Hey @fabiofcferreira, this library's example app is created with Expo managed workflow. So it's supporting the Expo already. You could reference the example app here.

Maybe it's because they are moved expo-haptics to JSI, it's not working properly with SDK 44. But this is just a thought I'll need to check the previous versions of Expo. ref: https://blog.expo.dev/expo-sdk-45-f4e332954a68