Repository navigation
Skip third-party components whose class is not linked instead of crashing at launch - #59067
Closed
YevheniiKotyrlo wants to merge 1 commit into
Closed
YevheniiKotyrlo wants to merge 1 commit into
YevheniiKotyrlo wants to merge 1 commit into
Conversation
…hing at launch RCTThirdPartyComponentsProvider built its map with a dictionary literal of NSClassFromString results, which throws when a component's library is not linked into the target: an app extension or App Clip that leaves a library out, or a macOS app whose dependencies include an iOS-only library. The provider now maps component names to class names and registers the classes the runtime has, as RCTModuleProviders does for module providers; a missing component falls back to the unimplemented view if it is rendered.
cipolleschi
approved these changes
Oct 14, 2026
cipolleschi
left a comment
Contributor
There was a problem hiding this comment.
thanks for fixing this.
|
@cipolleschi has imported this pull request. If you are a Meta employee, you can view this in D125236957. |
|
@cipolleschi merged this pull request in acc0cca. |
tvinhas
added a commit
to tvinhas/react-native-macos
that referenced
this pull request
Oct 28, 2026
Upstream v0.88.1 (30 commits, replayed onto the local v0.88.0 without the agent files). Conflicts: fork identities and the vlists '*' peer kept; Hermes 260318099.0.5; RCTStatusBarAppearance, the modal's status bar capture and RCTRootViewController are iOS-only (macOS has no status bar, visionOS lacks setNeedsStatusBarAppearanceUpdate); the SwiftUI filter container sets safeAreaRegions through RCTPlatformHostingController; SwiftPM autolinking keeps the per-platform UIKit/AppKit linker settings; RNTester Podfile.lock regenerated with pod install. Also from microsoft/react-native-macos (open PRs, macOS-only): secure TextInput focus crash (microsoft#3141), TextInput color for bullets and plain text (microsoft#3144), TextInput text stays put when resized while focused (microsoft#3150), ScrollView scrolls over a multiline TextInput (microsoft#3146), inverted lists on the new architecture (microsoft#3148), press over a TextInput (microsoft#3143), Dimensions follow window resizes (microsoft#3142, plus removing its observer on invalidate), RCTView shadow color retained (microsoft#3129), UIImage encoders extern "C" (microsoft#3140), layout direction constants (microsoft#3131), and codegen skipping unlinked third-party components (microsoft#3128, upstream react#59067). .yarnrc.yml preapproves hermes-compiler@260318099.0.5 past the 7-day age gate.
usama-liaqat
pushed a commit
to usama-liaqat/react-native
that referenced
this pull request
Nov 14, 2026
…hing at launch (react#59067) Summary: `RCTThirdPartyComponentsProvider.mm` builds its component map from a dictionary literal of `NSClassFromString` results. When a component's library is not linked into the target, such as an app extension or App Clip that leaves a library out (react#56469), or a macOS app whose dependencies include an iOS-only component library (react-native-macos generates the same file), `NSClassFromString` returns nil and the literal throws at launch: ``` *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[1]' ``` The provider now maps component names to class names and registers the classes the runtime has, the way `RCTModuleProviders.mm` already handles a module provider that cannot be found. A component left out this way falls back to `<UnimplementedView>` if it is rendered, as an unknown component does. ## Changelog: [IOS] [FIXED] - Skip third-party components whose class is not linked instead of crashing at launch Pull Request resolved: react#59067 Test Plan: - `generate-artifacts-executor-test.js`: the provider snapshots and the crawl case expect the name-to-class-name map. In Linux (WSL) the file's 52 tests and 24 snapshots pass; its suite-level `fs.rmdirSync(…, {recursive: true})` cleanup fails under Node 26, on `main` too. - The generated `RCTThirdPartyComponentsProvider.mm` for two component libraries, compiled into a binary that links only one of their classes (clang++, Foundation, macOS): - `main`: `NSInvalidArgumentException … attempt to insert nil object from objects[1]` - this change: `registered components: LinkedComponent` - `yarn flow`: no errors; eslint and prettier on the changed files: clean. Reviewed By: christophpurrer Differential Revision: D125236957 Pulled By: cipolleschi fbshipit-source-id: 55126e43352aad7275298978dceaa744a163f966
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
RCTThirdPartyComponentsProvider.mmbuilds its component map from a dictionary literal ofNSClassFromStringresults. When a component's library is not linked into the target, such as an app extension or App Clip that leaves a library out (#56469), or a macOS app whose dependencies include an iOS-only component library (react-native-macos generates the same file),NSClassFromStringreturns nil and the literal throws at launch:The provider now maps component names to class names and registers the classes the runtime has, the way
RCTModuleProviders.mmalready handles a module provider that cannot be found. A component left out this way falls back to<UnimplementedView>if it is rendered, as an unknown component does.Changelog:
[IOS] [FIXED] - Skip third-party components whose class is not linked instead of crashing at launch
Test Plan:
generate-artifacts-executor-test.js: the provider snapshots and the crawl case expect the name-to-class-name map. In Linux (WSL) the file's 52 tests and 24 snapshots pass; its suite-levelfs.rmdirSync(…, {recursive: true})cleanup fails under Node 26, onmaintoo.RCTThirdPartyComponentsProvider.mmfor two component libraries, compiled into a binary that links only one of their classes (clang++, Foundation, macOS):main:NSInvalidArgumentException … attempt to insert nil object from objects[1]registered components: LinkedComponentyarn flow: no errors; eslint and prettier on the changed files: clean.