Skip to content

Build fails on RN 0.76.7 + Sentry 6.14.0 (New Architecture) — Unsupported type: StringLiteralUnionTypeAnnotation #4870

Closed as not planned

Description

@mohib-uddin

What React Native libraries do you use?

React Native without Frameworks, RN New Architecture, Hermes

Are you using sentry.io or on-premise?

sentry.io (SaS)

@sentry/react-native SDK Version

6.14.0

How does your development environment look like?

I’m encountering a fatal build error when trying to run my React Native app using React Native v0.76.7, Sentry React Native v6.14.0, and New Architecture enabled.

Environment:

  • React Native version: 0.76.7

  • Sentry React Native version: 6.14.0

  • Node.js version: v22.11.0

  • Gradle: 8.10.2

  • Android Gradle Plugin: 8.6.0

  • New Architecture: ✅ Enabled

  • OS: Windows

Sentry.init()

Sentry.init({
  dsn: 'https://...@sentry.io/...'
  // other options
});

Steps to Reproduce

i) Install Sentry React Native v6.14.0

ii) Enable New Architecture in react-native.config.js

iii) Run: npm run android (with react-native run-android)

iv) Observe crash during codegen step

Expected Result

The project builds and runs without errors using the new architecture.

Actual Result

C:\Users\nonr\Desktop\Projects\Freelance\consumer\app\node_modules\react-native\node_modules@react-native\codegen\lib\generators\modules\GenerateModuleH.js:256
throw new Error(createErrorMessage(realTypeAnnotation.type));
^

Error: Unsupported type for param "type". Found: StringLiteralUnionTypeAnnotation
at translatePrimitiveJSTypeToCpp (C:\Users\nonr\Desktop\Projects\Freelance\consumer\app\node_modules\react-native\node_modules@react-native\codegen\lib\generators\modules\GenerateModuleH.js:256:13)
at getCppType (C:\Users\nonr\Desktop\Projects\Freelance\consumer\app\node_modules\react-native\node_modules@react-native\codegen\lib\generators\modules\GenerateModuleH.js:261:5)
at C:\Users\nonr\Desktop\Projects\Freelance\consumer\app\node_modules\react-native\node_modules@react-native\codegen\lib\generators\modules\GenerateModuleH.js:309:28
at Array.map ()
at C:\Users\nonr\Desktop\Projects\Freelance\consumer\app\node_modules\react-native\node_modules@react-native\codegen\lib\generators\modules\GenerateModuleH.js:308:10
at Array.map ()
at createStructsString (C:\Users\nonr\Desktop\Projects\Freelance\consumer\app\node_modules\react-native\node_modules@react-native\codegen\lib\generators\modules\GenerateModuleH.js:271:6)
at C:\Users\nonr\Desktop\Projects\Freelance\consumer\app\node_modules\react-native\node_modules@react-native\codegen\lib\generators\modules\GenerateModuleH.js:593:23
at Array.flatMap ()
at generate (C:\Users\nonr\Desktop\Projects\Freelance\consumer\app\node_modules\react-native\node_modules@react-native\codegen\lib\generators\modules\GenerateModuleH.js:586:48)

Node.js v22.11.0

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':sentry_react-native:generateCodegenArtifactsFromSchema'.

Process 'command 'cmd'' finished with non-zero exit value 1

  • Try:

Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.
Get more help at https://help.gradle.org.

BUILD FAILED in 1m
error Failed to install the app. Command failed with exit code 1: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
C:\Users\nonr\Desktop\Projects\Freelance\consumer\app\node_modules\react-native\node_modules@react-native\codegen\lib\generators\modules\GenerateModuleH.js:256 throw new Error(createErrorMessage(realTypeAnnotation.type)); ^ Error: Unsupported type for param "type". Found: StringLiteralUnionTypeAnnotation at translatePrimitiveJSTypeToCpp (C:\Users\nonr\Desktop\Projects\Freelance\consumer\app\node_modules\react-native\node_modules@react-native\codegen\lib\generators\modules\GenerateModuleH.js:256:13) at getCppType (C:\Users\nonr\Desktop\Projects\Freelance\consumer\app\node_modules\react-native\node_modules@react-native\codegen\lib\generators\modules\GenerateModuleH.js:261:5) at C:\Users\nonr\Desktop\Projects\Freelance\consumer\app\node_modules\react-native\node_modules@react-native\codegen\lib\generators\modules\GenerateModuleH.js:309:28 at Array.map () at C:\Users\nonr\Desktop\Projects\Freelance\consumer\app\node_modules\react-native\node_modules@react-native\codegen\lib\generators\modules\GenerateModuleH.js:308:10 at Array.map () at createStructsString (C:\Users\nonr\Desktop\Projects\Freelance\consumer\app\node_modules\react-native\node_modules@react-native\codegen\lib\generators\modules\GenerateModuleH.js:271:6) at C:\Users\nonr\Desktop\Projects\Freelance\consumer\app\node_modules\react-native\node_modules@react-native\codegen\lib\generators\modules\GenerateModuleH.js:593:23 at Array.flatMap () at generate (C:\Users\nonr\Desktop\Projects\Freelance\consumer\app\node_modules\react-native\node_modules@react-native\codegen\lib\generators\modules\GenerateModuleH.js:586:48) Node.js v22.11.0 FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':sentry_react-native:generateCodegenArtifactsFromSchema'. > Process 'command 'cmd'' finished with non-zero exit value 1 * Try: > Run with --stacktrace option to get the stack trace. > Run with --info or --debug option to get more log output. > Run with --scan to get full insights. > Get more help at https://help.gradle.org. BUILD FAILED in 1m.
info Run CLI with --verbose flag for more details.
PS C:\Users\nonr\Desktop\Projects\Freelance\consumer\app>

Activity

  1. added theissue type on May 28, 2025
  2. moved this to Waiting for: Product Owner in GitHub Issues with 👀 3on May 28, 2025
  3. lucas-zimerman commented on May 30, 2025

    @lucas-zimerman
    Collaborator

    Thank you for opening this PR. We will review it and get back to you once our investigation is complete.

  4. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3on May 30, 2025
  5. mohib-uddin commented on May 30, 2025

    @mohib-uddin
    Author

    Thank you for opening this PR. We will review it and get back to you once our investigation is complete.

    Update: I tried using versions 6.12 and 6.10 as well, but the same error persists. The error goes away if I disable the new architecture, but that significantly reduces the app’s performance.

  6. moved this to Waiting for: Product Owner in GitHub Issues with 👀 3on May 30, 2025
  7. lucas-zimerman commented on May 30, 2025

    @lucas-zimerman
    Collaborator

    Would you mind sharing your react-native.config.js ? also does it crash when you enable the new architecture on `gradle.properties`?

  8. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 3on May 30, 2025
  9. moved this to Waiting for: Community in GitHub Issues with 👀 3on Jun 20, 2025
  10. kahest commented on Jun 27, 2025

    @kahest
    Contributor

    Closing this due to lack of response. Feel free to comment with answers or updated information and we will reopen if it's actionable.

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

Metadata

Metadata

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions