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. |
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.