Codegen reads a Turbo Native Module's spec (Spec Files-Running Codegen): a Native... file exporting a Spec that extends TurboModule. A number becomes a Java double. CodegenTypes.Int32 documents an integer, yet React Native 0.86.3 36,878 's Codegen still declared this synchronous return a double, so the Kotlin override returns Double. Type app.config.ts too:
// specs/NativeBookShare.ts
import type { CodegenTypes, TurboModule } from 'react-native';
import { TurboModuleRegistry } from 'react-native';
export interface Spec extends TurboModule {
shareBook(title: string, url: string): Promise<boolean>;
getShareCount(): CodegenTypes.Int32;
}
export default TurboModuleRegistry.getEnforcing<Spec>('NativeBookShare');
// app.config.ts
import type { ConfigContext, ExpoConfig } from 'expo/config';
export default ({ config }: ConfigContext): ExpoConfig => ({
...config,
name: 'BookNest',
slug: 'booknest',
android: { ...config.android, package: 'com.example.booknest' },
extra: { apiUrl: process.env.EXPO_PUBLIC_API_URL ?? 'https://api.example.com' },
});With EXPO_PUBLIC_API_URL set, npx expo config --type public prints name: 'BookNest' and that apiUrl. Expo 6,418 types process.env entries as string | undefined, so assigning one to a string fails with "Type 'string | undefined' is not assignable to type 'string'". Check once in src/config/env.ts, if (!apiUrl) throw ..., and export the narrowed value (Env and app.config).