Skip to content

codegen fails for StringEnumTypeAnnotation #49566

Open
@vonovak

Description

Description

Hi! Not sure why it has surfaced now and not before, but seems like https://github.com/facebook/react-native/pull/48343/files broke codegen for these kinds of usages: https://github.com/callstack/react-native-pager-view/blob/2afcbf9bcfbfad0bee90c66c344f5cfebcf9836a/src/PagerViewNativeComponent.ts#L23

Apologies, I don't have an isolated repro now, as I'm finishing other stuff first

stacktrace below

Steps to reproduce

I don't have an isolated repro now but I think creating a clean project and adding react-native-pager-view and then building for Android will reproduce the issue

React Native Version

0.78.0

Affected Platforms

Runtime - Android

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

System:
  OS: macOS 15.3.1
  CPU: (10) arm64 Apple M1 Max
  Memory: 335.86 MB / 64.00 GB
  Shell:
    version: 5.2.15
    path: /opt/homebrew/bin/bash
Binaries:
  Node:
    version: 23.6.1
    path: /opt/homebrew/bin/node
  Yarn:
    version: 1.22.22
    path: /opt/homebrew/bin/yarn
  npm:
    version: 10.9.2
    path: /opt/homebrew/bin/npm
  Watchman:
    version: 2024.10.21.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.16.2
    path: /Users/vojta/_dev/expo/.direnv/bin/pod

Stacktrace or Logs

> Task :react-native-pager-view:generateCodegenArtifactsFromSchema FAILED
/Users/vojta/_dev/expo/node_modules/react-native/node_modules/@react-native/codegen/lib/generators/components/GenerateEventEmitterCpp.js:311
          throw new Error(
          ^

Error: Received invalid event property type StringEnumTypeAnnotation
    at /Users/vojta/_dev/expo/node_modules/react-native/node_modules/@react-native/codegen/lib/generators/components/GenerateEventEmitterCpp.js:311:17
    at Array.map (<anonymous>)
    at generateSetters (/Users/vojta/_dev/expo/node_modules/react-native/node_modules/@react-native/codegen/lib/generators/components/GenerateEventEmitterCpp.js:260:6)
    at generateEvent (/Users/vojta/_dev/expo/node_modules/react-native/node_modules/@react-native/codegen/lib/generators/components/GenerateEventEmitterCpp.js:333:7)
    at /Users/vojta/_dev/expo/node_modules/react-native/node_modules/@react-native/codegen/lib/generators/components/GenerateEventEmitterCpp.js:386:25
    at Array.map (<anonymous>)
    at /Users/vojta/_dev/expo/node_modules/react-native/node_modules/@react-native/codegen/lib/generators/components/GenerateEventEmitterCpp.js:386:12
    at Array.map (<anonymous>)
    at generate (/Users/vojta/_dev/expo/node_modules/react-native/node_modules/@react-native/codegen/lib/generators/components/GenerateEventEmitterCpp.js:383:8)
    at Object.generate (/Users/vojta/_dev/expo/node_modules/react-native/node_modules/@react-native/codegen/lib/generators/RNCodegen.js:212:9)

Reproducer

https://github.com/callstack/react-native-pager-view

Screenshots and Videos

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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