Skip to content

codegen fails for StringEnumTypeAnnotation #49566

Closed

Description

@vonovak

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

  1. react-native-bot commented on Feb 20, 2025

    @react-native-bot
    Collaborator

    Warning

    Could not parse version: We could not find or parse the version number of React Native in your issue report. Please use the template, and report your version including major, minor, and patch numbers - e.g. 0.76.2.

  2. added
    Needs: Repro
    and removed on Feb 20, 2025
  3. react-native-bot commented on Feb 20, 2025

    @react-native-bot
    Collaborator

    Warning

    Missing reproducer: We could not detect a reproducible example in your issue report. Please provide either:

  4. react-native-bot commented on Feb 20, 2025

    @react-native-bot
    Collaborator

    Warning

    Could not parse version: We could not find or parse the version number of React Native in your issue report. Please use the template, and report your version including major, minor, and patch numbers - e.g. 0.76.2.

  5. cortinico commented on Feb 20, 2025

    @cortinico
    Contributor
  6. vonovak commented on Feb 24, 2025

    @vonovak
    ContributorAuthor

    apologies, as the stack hints, it was cause by multiple versions of @react-native/codegen being presents

  7. added
    Needs: Attention
    and removed on Feb 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs: AttentionNeeds: ReproNeeds: Version Info

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions