Skip to content

codegenConfig breaks iOS pod install on New Architecture (RN 0.85+) — TSTypeReference in NativeA0Auth0 spec #1553

@praveen-18m

Description

@praveen-18m

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-auth0lib/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

  1. Add react-native-auth0 to an Expo 56 / RN 0.85 app with New Architecture enabled.
  2. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis points to a verified bug in the code

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions