Skip to content

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

Open
@mohib-uddin

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://[email protected]/...'
  // 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>

Metadata

Metadata

Type

Projects

Status

Waiting for: Community

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions