nandorojo / solito

🧍‍♂️ React Native + Next.js, unified.
https://solito.dev
MIT License
3.53k stars 179 forks source link

iOS Simulator: Unable to resolve module expo-image from .../node_modules/solito/build/image/expo/image.js #434

Closed sejori closed 1 year ago

sejori commented 1 year ago

Is there an existing issue for this?

Do you want this issue prioritized?

Current Behavior

App compiles and renders correctly when targeting web with next but title error is shown on simulator with expo. Can successfully create development builds on AES and launch but nothing rendered before error.

Expected Behavior

Native app would render shared app packages same as on web.

Steps To Reproduce

  1. Create expo-router starter template
  2. Implement listed packages: "@react-native-async-storage/async-storage": "^1.19.2", "@react-native-picker/picker": "^2.5.0", "@tamagui/checkbox": "^1.72.1", "@tamagui/config": "^1.72.1", "@tamagui/lucide-icons": "^1.72.1", "expo-document-picker": "^11.7.0", "expo-image-picker": "^14.3.2", "expo-linear-gradient": "^12.3.0", "expo-navigation-bar": "^2.3.0", "expo-web-browser": "^12.3.2", "hex-color-regex": "^1.1.0", "hex-opacity": "^1.0.16", "next-fonts": "^1.5.1", "react-hover-image": "^2.0.1", "react-native-iphone-x-helper": "^1.3.1", "react-native-keyboard-aware-scroll-view": "^0.9.5", "react-native-paper": "^5.10.4", "react-native-sectioned-multi-select": "^0.10.0", "react-native-svg": "^13.12.0", "react-native-vector-icons": "^10.0.0", "react-native-web-swiper": "^2.2.4", "react-native-webview": "^13.3.1", "react-responsive": "^9.0.2", "tamagui": "^1.72.1"
  3. Build app on AES
  4. Try to run app on simulator

(Note: I have tried the react-fast-image implementation and the default expo-image, same result)

Versions

- Solito: 4.0.1 (originally 3.0.0)
- Next.js: 13.2.0
- Expo: ~48.0.18
- React Native: 0.71.8

Screenshots

error screenshot

react-fast-image attempt

Reproduction

App bundle download - can give access to source on request

nandorojo commented 1 year ago

you’ll need to install a new dev client for expo-image to work i assume. sounds like it’s not installed properly.

sejori commented 1 year ago

install a new dev-client, you mean make a new dev build on EAS and run that in simulator?

I think I have tried that for both react-fast-image and default expo-image but can try again.

sejori commented 1 year ago

@nandorojo so weirdly there was no expo-image installed. Maybe I had accidentally uninstalled. After reinstalling into apps/expo/package.json the error is gone. We are now facing another issue, please tell me if you would prefer to close this issue and open another one.

The new error is:

Error: Cannot find native module 'ExponentImagePicker', js engine: hermes at RootRouteNodeProvider (http://192.168.0.182:8081/index.bundle?platform=ios&dev=true&hot=false:110294:23) at ContextNavigator (http://192.168.0.182:8081/index.bundle?platform=ios&dev=true&hot=false:114681:24) at RNCSafeAreaProvider at SafeAreaProvider (http://192.168.0.182:8081/index.bundle?platform=ios&dev=true&hot=false:103003:24) at RCTView at View (http://192.168.0.182:8081/index.bundle?platform=ios&dev=true&hot=false:48499:43) at GestureHandlerRootView at GestureHandler at ExpoRoot (http://192.168.0.182:8081/index.bundle?platform=ios&dev=true&hot=false:114668:24) at App at withDevTools(App) (http://192.168.0.182:8081/index.bundle?platform=ios&dev=true&hot=false:143491:27) at ErrorToastContainer (http://192.168.0.182:8081/index.bundle?platform=ios&dev=true&hot=false:143415:24) at ErrorOverlay at RCTView at View (http://192.168.0.182:8081/index.bundle?platform=ios&dev=true&hot=false:48499:43) at RCTView at View (http://192.168.0.182:8081/index.bundle?platform=ios&dev=true&hot=false:48499:43) at AppContainer (http://192.168.0.182:8081/index.bundle?platform=ios&dev=true&hot=false:48376:36) at main(RootComponent) (http://192.168.0.182:8081/index.bundle?platform=ios&dev=true&hot=false:84581:28)

nandorojo commented 1 year ago

same issue but with expo-image-picker

sejori commented 1 year ago

Ahah you're right! So basically the idea is that all packages required by expo app must be present in the apps/expo/package.json and the root package.json?

nandorojo commented 1 year ago

IMG_4919

native deps go in the expo folder

sejori commented 1 year ago

Brill - thanks for that and great work on the stack 👏