Skip to content

fix: [SDK-4390] bump react-native peer dep to >=0.79.0 for TurboModule support#1944

Merged
fadi-george merged 2 commits intomainfrom
fadi/sdk-4390-bug-expo-52-rn-076-new-arch-onesignal-turbomodule-not
Apr 28, 2026
Merged

fix: [SDK-4390] bump react-native peer dep to >=0.79.0 for TurboModule support#1944
fadi-george merged 2 commits intomainfrom
fadi/sdk-4390-bug-expo-52-rn-076-new-arch-onesignal-turbomodule-not

Conversation

@fadi-george
Copy link
Copy Markdown
Collaborator

Description

One Line Summary

Bump the react-native peer dependency to >=0.79.0 and document the requirement so apps on RN 0.76 to 0.78 don't hit a runtime TurboModuleRegistry.getEnforcing(...): 'OneSignal' could not be found crash.

Details

Motivation

Reported in #1943. On Expo SDK 52 / RN 0.76 with the New Architecture enabled, react-native-onesignal@5.4.x crashes at JS startup with Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'OneSignal' could not be found. Root cause: 5.4.x registers its iOS TurboModule through the codegenConfig.ios.modulesProvider field in package.json, which was added in React Native 0.79. On 0.79+, codegen emits an RCTModuleProviders.mm shim that registers the module with RCTAppDependencyProvider. RN 0.76 silently ignores the field, no shim is generated, and bridgeless TurboModule lookup fails. The peer dep currently advertises >=0.76.0, which is why this isn't caught at install time.

Scope

  • Bumps peerDependencies.react-native from >=0.76.0 to >=0.79.0 in package.json.
  • Adds a Requirements section to README.md calling out the RN 0.79 floor.
  • Adds a migration advisory at the top of MIGRATION_GUIDE.md for v5.4.x.
  • No native code or runtime behavior changes.

Testing

Manual testing

Reproduced the crash end to end using a fresh Expo SDK 52 / RN 0.76 / new arch project with react-native-onesignal@5.4.3:

  • Source-level: confirmed RN 0.76.5 has zero references to modulesProvider or RCTModuleProvider, while RN 0.81.5 has the full template/generator stack.
  • Build-level: expo prebuild + pod install produces no RCTModuleProviders.mm or RCTAppDependencyProvider.mm on RN 0.76; demo2 on RN 0.81 generates both with the OneSignal entry.
  • Runtime: bridgeless TurboModuleRegistry.getEnforcing('OneSignal') throws the exact Invariant Violation from the issue.

After the peer dep bump, npm/yarn/pnpm/bun will warn (or error in strict modes) on incompatible RN versions before the user hits the runtime crash.

Affected code checklist

  • Public API changes (peer dependency contract change, docs)

Checklist

Overview

  • I have filled out all REQUIRED sections above
  • PR does one thing
  • Any Public API changes are explained in the PR details and conform to existing APIs

Testing

  • I have included test coverage for these changes, or explained why they are not needed (docs / package.json only)
  • All automated tests pass, or I explained why that is not possible
  • I have personally tested this on my device, or explained why that is not possible

Final pass

  • Code is as readable as possible.
  • I have reviewed this PR myself, ensuring it meets each checklist item

Made with Cursor

@fadi-george fadi-george requested a review from a team as a code owner April 28, 2026 18:58
Comment thread package.json
@fadi-george fadi-george merged commit 233c9e7 into main Apr 28, 2026
7 checks passed
@fadi-george fadi-george deleted the fadi/sdk-4390-bug-expo-52-rn-076-new-arch-onesignal-turbomodule-not branch April 28, 2026 22:10
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