facebook / react-native

A framework for building native applications using React
https://reactnative.dev
MIT License
118.19k stars 24.21k forks source link

Error with react-native-compat + Expo Go crashes on iOS when trying to create a Web3Wallet instance #44816

Closed Patryqss closed 3 months ago

Patryqss commented 3 months ago

Description

I'm trying to use a Web3Wallet library in my app. I followed the documentation presented here and here and I have two issues:

First, the import of @walletconnect/react-native-compat throws an error: react-native-compat: Application module is not available While searching for similar problems, I only found one example but it was not solved

Second, if I try to run the app on iOS Simulator or an iPhone, running Web3Wallet.init (clicking on the button in the Reproducer example) crashes my Expo Go app without even throwing a single log. It may be somehow connected to the first issue but I'm not sure since it works fine on an Android device

Steps to reproduce

Follow the Readme file in the Reproducer link

React Native Version

0.74.1

Affected Platforms

Runtime - iOS

Output of npx react-native info

System:
  OS: macOS 14.4.1
  CPU: (10) arm64 Apple M1 Pro
  Memory: 1.28 GB / 32.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 18.18.2
    path: ~/.nvm/versions/node/v18.18.2/bin/node
  Yarn:
    version: 1.22.19
    path: /opt/homebrew/bin/yarn
  npm:
    version: 10.8.1
    path: ~/Documents/Test-Expo-and-Web3Wallet/node_modules/.bin/npm
  Watchman:
    version: 2023.11.27.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.14.3
    path: /opt/homebrew/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 23.5
      - iOS 17.5
      - macOS 14.5
      - tvOS 17.5
      - visionOS 1.2
      - watchOS 10.5
  Android SDK:
    API Levels:
      - "33"
      - "34"
    Build Tools:
      - 30.0.3
      - 33.0.0
      - 33.0.1
      - 34.0.0
    System Images:
      - android-33 | Intel x86_64 Atom
      - android-33 | Google TV Intel x86 Atom
      - android-33 | Google APIs ARM 64 v8a
      - android-34 | Google APIs ARM 64 v8a
    Android NDK: Not Found
IDEs:
  Android Studio: 2022.3 AI-223.8836.35.2231.10671973
  Xcode:
    version: 15.4/15F31d
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.11
    path: /usr/bin/javac
  Ruby:
    version: 2.6.10
    path: /usr/bin/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.74.1
    wanted: 0.74.1
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: Not found
  newArchEnabled: Not found
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found

Stacktrace or Logs

At the start of application:
ERROR  react-native-compat: Application module is not available

And after clicking on the button, it just crashes, there are no logs at all.

Reproducer

https://github.com/Patryqss/Test-Expo-and-Web3Wallet

Screenshots and Videos

https://github.com/facebook/react-native/assets/53139396/2b64b7ae-bf98-4c2d-8d88-ee548190d503

github-actions[bot] commented 3 months ago
:warning: Newer Version of React Native is Available!
:information_source: You are on a supported minor version, but it looks like there's a newer patch available - 0.74.2. Please upgrade to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases.
github-actions[bot] commented 3 months ago
:warning: Issue is Related to Expo
:information_source: It looks like your issue is related to Expo and not React Native core. Please open your issue in Expo's repository. If you are able to create a repro that showcases that this issue is also happening in React Native vanilla, we will be happy to re-open.
cortinico commented 3 months ago

Also for the issue related to @walletconnect/react-native-compat, please open this same issue against the library issue tracker