Checklist
Description
With React Native New Architecture enabled, pod install fails during Codegen while processing RNAuth0Spec from react-native-auth0.
The TurboModule spec uses imported types (e.g. Promise<Credentials>) that React Native Codegen does not support. This matches the failure mode discussed in #1037, where removing codegenConfig was the recommended interop-layer approach until full TurboModule support is ready.
Environment
react-native-auth0: 5.6.0 (also reproduced on 5.0.1)
react-native: 0.85.3
expo: ^56.0.0
- Node: 20.x
- Platform: iOS (
pod install / expo run:ios)
- New Architecture: enabled (Expo SDK 56 default)
Expected behavior
pod install completes and the app builds with New Architecture.
Actual behavior
Codegen fails and CocoaPods reports an invalid Podfile:
[Codegen] Processing RNAuth0Spec
[Codegen] UnsupportedTypeAnnotationParserError: Module NativeA0Auth0: TypeScript type annotation 'TSTypeReference' is unsupported in NativeModule specs.
The spec references imported types, for example:
import type { Credentials } from '../types';
// ...
getCredentials(...): Promise<Credentials>;
webAuth(...): Promise<Credentials>;
(node_modules/react-native-auth0 — lib/typescript/src/specs/NativeA0Auth0.d.ts or src/specs/NativeA0Auth0.ts)
Workaround (confirmed)
Remove codegenConfig from react-native-auth0's package.json (via patch-package). Auth0 continues to work via the bridge + New Architecture interop layer. After removing it, Codegen skips RNAuth0Spec and pod install succeeds.
This aligns with the React WG guidance quoted in #1037:
If you have already added a Codegen spec to your library, but the library is not fully converted to TurboModules/Fabric, we recommend that you delete it before proceeding.
Suggested fix (either is fine)
Option A (preferred for now): Remove codegenConfig from published package.json until the library is fully TurboModule-ready (same as interop approach in #1037).
Option B: Keep codegenConfig but change NativeA0Auth0 so all return/param types are Codegen-compatible (inline object types / primitives only — no imported Credentials / ApiCredentials references).
Related issues / PRs
Reproduction
- Add
react-native-auth0 to an Expo 56 / RN 0.85 app with New Architecture enabled.
- Run
cd ios && pod install (or npx expo run:ios).
Additional context
No response
react-native-auth0 version
5.6.0
React Native version
0.85.3
Expo version
^56.0.0
Platform
Android, iOS
Platform version(s)
16.4
Checklist
Description
With React Native New Architecture enabled,
pod installfails during Codegen while processingRNAuth0Specfromreact-native-auth0.The TurboModule spec uses imported types (e.g.
Promise<Credentials>) that React Native Codegen does not support. This matches the failure mode discussed in #1037, where removingcodegenConfigwas the recommended interop-layer approach until full TurboModule support is ready.Environment
react-native-auth0: 5.6.0 (also reproduced on 5.0.1)react-native: 0.85.3expo: ^56.0.0pod install/expo run:ios)Expected behavior
pod installcompletes and the app builds with New Architecture.Actual behavior
Codegen fails and CocoaPods reports an invalid
Podfile:The spec references imported types, for example:
(
node_modules/react-native-auth0—lib/typescript/src/specs/NativeA0Auth0.d.tsorsrc/specs/NativeA0Auth0.ts)Workaround (confirmed)
Remove
codegenConfigfromreact-native-auth0'spackage.json(viapatch-package). Auth0 continues to work via the bridge + New Architecture interop layer. After removing it, Codegen skipsRNAuth0Specandpod installsucceeds.This aligns with the React WG guidance quoted in #1037:
Suggested fix (either is fine)
Option A (preferred for now): Remove
codegenConfigfrom publishedpackage.jsonuntil the library is fully TurboModule-ready (same as interop approach in #1037).Option B: Keep
codegenConfigbut changeNativeA0Auth0so all return/param types are Codegen-compatible (inline object types / primitives only — no importedCredentials/ApiCredentialsreferences).Related issues / PRs
react_codegen_RNAuth0SpeclinkingcodegenConfigfor v4 interop; v5.x still ships itReproduction
react-native-auth0to an Expo 56 / RN 0.85 app with New Architecture enabled.cd ios && pod install(ornpx expo run:ios).Additional context
No response
react-native-auth0 version
5.6.0
React Native version
0.85.3
Expo version
^56.0.0
Platform
Android, iOS
Platform version(s)
16.4