Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bridgeless][IOS] bridge is nil on Swift when NewArch is enabled #45232

Open
lodev09 opened this issue Jul 1, 2024 · 0 comments
Open

[Bridgeless][IOS] bridge is nil on Swift when NewArch is enabled #45232

lodev09 opened this issue Jul 1, 2024 · 0 comments
Labels
Issue: Author Provided Repro This issue can be reproduced in Snack or an attached project. Platform: iOS iOS applications. Type: New Architecture Issues and PRs related to new architecture (Fabric/Turbo Modules)

Comments

@lodev09
Copy link

lodev09 commented Jul 1, 2024

Description

I maintain a native component library and trying to make it work with New Architecture interop. It builds without problem. However, the bridge in the view manager instance is nil and causing the component to crash.

To give context, the library is similar to RN Modal where it uses the view component as a host view of a view controller. It needs the bridge to attach RCTTouchHandler to the container view. The library is written in swift. https://github.com/lodev09/react-native-true-sheet

Any ideas or I'm missing something?

Steps to reproduce

  1. Clone the library
  2. Modify example/app.json and set newArchEnabled: true at line 38
  3. Run the example project
  4. Notice the crash

React Native Version

0.74.2

Affected Platforms

Runtime - iOS

Areas

Bridgeless - The New Initialization Flow

Output of npx react-native info

System:
  OS: macOS 14.5
  CPU: (10) arm64 Apple M1 Pro
  Memory: 355.75 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 18.20.3
    path: ~/.nvm/versions/node/v18.20.3/bin/node
  Yarn:
    version: 4.2.2
    path: ~/.nvm/versions/node/v18.20.3/bin/yarn
  npm:
    version: 10.8.1
    path: ~/.nvm/versions/node/v18.20.3/bin/npm
  Watchman: Not Found
Managers:
  CocoaPods:
    version: 1.15.2
    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: Not Found
IDEs:
  Android Studio: 2023.2 AI-232.10300.40.2321.11668458
  Xcode:
    version: 15.4/15F31d
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.10
    path: /usr/bin/javac
  Ruby:
    version: 3.0.6
    path: /Users/lodev09/.rbenv/shims/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.74.2
    wanted: 0.74.2
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: true
  newArchEnabled: true

Stacktrace or Logs

TrueSheet/TrueSheetViewManager.swift:22: Fatal error: Unexpectedly found nil while implicitly unwrapping an Optional value

Reproducer

https://github.com/lodev09/react-native-true-sheet/tree/main/example

Screenshots and Videos

Screenshot 2024-07-01 at 22 03 16
@lodev09 lodev09 added Needs: Triage 🔍 Type: New Architecture Issues and PRs related to new architecture (Fabric/Turbo Modules) labels Jul 1, 2024
@github-actions github-actions bot added the Platform: iOS iOS applications. label Jul 1, 2024
@lodev09 lodev09 changed the title [Bridgeless][IOS] bridge is nil on Swift when NewArch is enabled [Bridgeless][IOS] bridge is nil on Swift when NewArch is enabled Jul 1, 2024
@cortinico cortinico added Issue: Author Provided Repro This issue can be reproduced in Snack or an attached project. and removed Needs: Triage 🔍 labels Jul 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue: Author Provided Repro This issue can be reproduced in Snack or an attached project. Platform: iOS iOS applications. Type: New Architecture Issues and PRs related to new architecture (Fabric/Turbo Modules)
Projects
None yet
Development

No branches or pull requests

2 participants