Skip to content

[0.79.0] Unsupported top level event type "topTap" dispatched #50667

Closed
@mgcrea

Description

@mgcrea

Description

I was playing with a swift-enabled fabric-component library example I built a while ago and wanted to add event handling to a basic Swift ColorView. Somehow react-native complains about an unsupported top level "event":

Error: Unsupported top level event type "topTap" dispatched, js engine: hermes

I guess there might be something silly going on, what is very strange is that I don't encounter the issue on a more involved setup (https://github.com/mgcrea/react-native-swiftui) that has the exact same objective-c code, but is using more complex swift code (UIHostingViewController, etc.), tested with 0.79 as well.

Image

Issue looks close to this old issue: #34072

Steps to reproduce

  1. Got to the example folder and install dependencies with pnpm (to allow linking).
  2. pnpm install:ios
  3. pnpm open:ios
  4. tap on the green box (native swift ColorView)

React Native Version

0.79.0

Affected Platforms

Runtime - iOS

Areas

Fabric - The New Renderer

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

System:
  OS: macOS 15.3.1
  CPU: (10) arm64 Apple M1 Max
  Memory: 743.44 MB / 32.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 22.14.0
    path: /opt/homebrew/opt/node@22/bin/node
  Yarn: Not Found
  npm:
    version: 10.9.2
    path: /opt/homebrew/opt/node@22/bin/npm
  Watchman:
    version: 2025.02.17.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.16.2
    path: /opt/homebrew/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 24.4
      - iOS 18.4
      - macOS 15.4
      - tvOS 18.4
      - visionOS 2.4
      - watchOS 11.4
  Android SDK: Not Found
IDEs:
  Android Studio: 2023.2 AI-232.10227.8.2321.11479570
  Xcode:
    version: 16.3/16E140
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.14
    path: /usr/bin/javac
  Ruby:
    version: 3.4.2
    path: /opt/homebrew/opt/ruby/bin/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 18.0.0
    wanted: 18.0.0
  react:
    installed: 19.0.0
    wanted: 19.0.0
  react-native:
    installed: 0.79.0
    wanted: 0.79.0
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: true
  newArchEnabled: true

Stacktrace or Logs

console.js:654 Error: Unsupported top level event type "topTap" dispatched, js engine: hermes
anonymous	@	console.js:654
overrideMethod	@	backend.js:17785
reactConsoleErrorHandler	@	ExceptionsManager.js:182
anonymous	@	setUpDeveloperTools.js:40
registerError	@	LogBox.js:231
anonymous	@	LogBox.js:80
reportException	@	ExceptionsManager.js:111
handleException	@	ExceptionsManager.js:171
handleError	@	setUpErrorHandling.js:25
reportFatalError	@	error-guard.js:49

Reproducer

https://github.com/mgcrea/react-native-fabric-component-library-example

Screenshots and Videos

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions