Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fix react-native-reanimated is not installed! error #2953

Merged
merged 2 commits into from
Jun 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions package/src/dependencies/ModuleProxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@ export const createModuleProxy = <TModule>(getModule: () => ImportType): TModule

const proxy = new Proxy(holder, {
get: (target, property) => {
if (property === '$$typeof') {
// If inlineRequires is enabled, Metro will look up all imports
// with the $$typeof operator. In this case, this will throw the
// `OptionalDependencyNotInstalledError` error because we try to access the module
// even though we are not using it (Metro does it), so instead we return undefined
// to bail out of inlineRequires here.
// See https://github.com/mrousavy/react-native-vision-camera/pull/2953
return undefined
}

if (target.module == null) {
// lazy initialize module via require()
// caller needs to make sure the require() call is wrapped in a try/catch
Expand Down