Skip to content

"No component found for view with name" error received in macos build when trying to implement and use a custom fabric native component #2742

@Roshan-24

Description

@Roshan-24

Description

I have setup a fresh react-native-macos project following the steps here
I have then setup a sample fabric native component by following the steps here (The docs for version 0.78)

Since the RN macos docs mentioned that the same steps as ios applies for macos as well, in addition to using AppKit instead of UIKit, I have followed the same steps for macos as well as for ios.

When I run the ios build (react-native run-ios), the app opens and I am able to see the native component load properly
However, when i run the macos build (react-native run-macos), the app opens but I am greeted with a "No component found for view with name "CustomWebView" runtime error

Is the steps to register a fabric component different for macos?

Steps to reproduce

[Code in reproducer repo created by only and exactly following the steps in this doc]

  1. Clone the reproducer repo
  2. Run npm install
  3. Run pod install --project-directory=macos
  4. Run npm run macos
  5. Runtime error appears on app launch

React Native Version

0.78.3

Affected Platforms

Runtime - Desktop

Areas

Fabric - The New Renderer

Output of npx @react-native-community/cli info

info Fetching system and libraries information...
System:
  OS: macOS 15.7.1
  CPU: (10) arm64 Apple M1 Pro
  Memory: 124.72 MB / 32.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 22.17.1
    path: /Users/roshanbx/.local/share/mise/installs/node/22.17.1/bin/node
  Yarn: Not Found
  npm:
    version: 10.9.2
    path: /Users/roshanbx/.local/share/mise/installs/node/22.17.1/bin/npm
  Watchman: Not Found
Managers:
  CocoaPods:
    version: 1.16.2
    path: /Users/roshanbx/.local/share/mise/installs/ruby/3.4.7/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 25.0
      - iOS 26.0
      - macOS 26.0
      - tvOS 26.0
      - visionOS 26.0
      - watchOS 26.0
  Android SDK: Not Found
IDEs:
  Android Studio: Not Found
  Xcode:
    version: 26.0.1/17A400
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 22.0.2
    path: /usr/bin/javac
  Ruby:
    version: 3.4.7
    path: /Users/roshanbx/.local/share/mise/installs/ruby/3.4.7/bin/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 15.0.1
    wanted: 15.0.1
  react:
    installed: 19.0.0
    wanted: 19.0.0
  react-native:
    installed: 0.78.3
    wanted: 0.78.3
  react-native-macos:
    installed: 0.78.6
    wanted: ^0.78.6
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: true
  newArchEnabled: true

info React Native v0.82.1 is now available (your project is running on v0.78.3).
info Changelog: https://github.com/facebook/react-native/releases/tag/v0.82.1
info Diff: https://react-native-community.github.io/upgrade-helper/?from=0.78.3&to=0.82.1
info For more info, check out "https://reactnative.dev/docs/upgrading?os=macos".

Stacktrace or Logs

No component found for view with name "CustomWebView"

-[RCTUIManager createView:viewName:rootTag:props:]
    RCTUIManager.mm:990
__invoking___
-[NSInvocation invoke]
-[NSInvocation invokeWithTarget:]
-[RCTModuleMethod invokeWithBridge:module:arguments:]
facebook::react::invokeInner(RCTBridge*, RCTModuleData*, unsigned int, folly::dynamic const&, int, (anonymous namespace)::SchedulingContext)
facebook::react::RCTNativeModule::invoke(unsigned int, folly::dynamic&&, int)::$_0::operator()() const
invocation function for block in facebook::react::RCTNativeModule::invoke(unsigned int, folly::dynamic&&, int)
_dispatch_call_block_and_release
_dispatch_client_callout
_dispatch_lane_serial_drain
_dispatch_lane_invoke
_dispatch_root_queue_drain_deferred_wlh
_dispatch_workloop_worker_thread
_pthread_wqthread
start_wqthread

Reproducer

https://github.com/Roshan-24/macos-rn-fabric-bug-reproducer

Screenshots and Videos

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions