Repository navigation
fix(cv): name the opencv lib when an app opted out of it - #1624
Open
msluszniak wants to merge 1 commit into
Open
msluszniak wants to merge 1 commit into
msluszniak wants to merge 1 commit into
Conversation
With OpenCV off the native installer never adds the cv namespace, so every CV task failed with "Cannot read property 'resize' of undefined". Route the calls through cvJsi(), which throws INVALID_STATE naming the lib to add, and check it when the image preprocessor is created so tasks fail at construction. Closes #1618
barhanc
approved these changes
Nov 6, 2026
barhanc
left a comment
Member
There was a problem hiding this comment.
Other than the naming nit, looks good.
| * has no OpenCV. | ||
| * @internal | ||
| */ | ||
| export function cvJsi() { |
Member
There was a problem hiding this comment.
Maybe something like tryInitJsiCv would better convey what this function does.
This branch has not been deployed
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.
Description
cvnamespace throughcvJsi(), which throwsINVALID_STATEnaming theopencvlib when the app opted out of it, instead ofCannot read property 'resize' of undefined.Introduces a breaking change?
Type of change
Tested on
Testing instructions
yarn workspace react-native-executorch test(new case inclassification.test.ts)."libs": [], creating a classifier now rejects with the message above.Screenshots
Related issues
Closes #1618
Checklist
Additional notes