Skip to content

Convert union type to string to fix codegen error - #6550

Open
naftalibeder wants to merge 1 commit into
getsentry:mainfrom
naftalibeder:fix/codegen-union-type
Open

Convert union type to string to fix codegen error#6550
naftalibeder wants to merge 1 commit into
getsentry:mainfrom
naftalibeder:fix/codegen-union-type

Conversation

@naftalibeder

@naftalibeder naftalibeder commented Jul 31, 2026

Copy link
Copy Markdown

📢 Type of change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring

📜 Description

Running assemble on Android errors with the message:

Unsupported type for param "type". Found: StringLiteralUnionTypeAnnotation

💡 Motivation and Context

Union types are no longer supported in React Native Codegen. I'm not able to find documentation confirming this, but it appears to be an issue others have encountered.

Related:
react/react-native#49566
#4870
react-native-webview/react-native-webview#3767

@alwx

alwx commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Hey @naftalibeder and thanks for the PR!

Before we take this, I'd like to pin down the root cause, because I can't reproduce the error from the spec file alone.
I ran @react-native/codegen's TypeScript parser over the unmodified NativeRNSentry.ts, and was unable to reproduce the issue.

Could you share the following with me?

  1. your react-native version
  2. the output of yarn why @react-native/codegen (or the npm equivalent),
  3. whether the error survives a clean build — ./gradlew clean plus deleting the generated codegen output and schema.json under android/build / node_modules/@sentry/react-native/android/build

Thanks a lot!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants