realm / realm-js

Realm is a mobile database: an alternative to SQLite & key-value stores
https://realm.io
Apache License 2.0
5.72k stars 564 forks source link

Could not find realm binary when show react-native component in native iOS app #6803

Open Mekongoabanda opened 1 month ago

Mekongoabanda commented 1 month ago

could not find realm binary

How frequently does the bug occur?

Always

Description

Hello guys, i hope you're well Has anyone ever had a problem with Realm when they want to use a react-native component in an iOS ViewController? Error: Could not find real binary I have already tried several possible solutions (the one proposed in log included). For information:

For example, in my index.js i've try to show ModuleEntryPoint.tsx registred like that: AppRegistry.registerComponent("ModuleEntryPoint", () => ModuleEntryPoint); When i call it from my native code (Objective-C or Swift). and I use Realm in ModuleEntryPoint.tsx I have this error, but when I do not use realm my compsant is displayed normally and works well I need help

Stacktrace & log output

** Error**: 
Could not find the Realm binary. Please consult our troubleshooting guide: https://www.mongodb.com/docs/realm-sdks/js/latest/#md:troubleshooting-missing-binary
Error: Unable to resolve module ./node_modules/realm/binding/generated/native.react-native from /Users/../Documents/projectName: 

None of these files exist:
  * node_modules/realm/binding/generated/native.react-native(.ios.js|.native.js|.js|.ios.jsx|.native.jsx|.jsx|.ios.json|.native.json|.json|.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx)
  * node_modules/realm/binding/generated/native.react-native/index(.ios.js|.native.js|.js|.ios.jsx|.native.jsx|.jsx|.ios.json|.native.json|.json|.ios.ts|.native.ts|.ts|.ios.tsx|.native.tsx|.tsx)
    at ModuleResolver.resolveDependency (node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:112:15)
    at DependencyGraph.resolveDependency (/node_modules/metro/src/node-haste/DependencyGraph.js:231:43)
    at /node_modules/metro/src/lib/transformHelpers.js:156:21
    at Server._resolveRelativePath (/node_modules/metro/src/Server.js:1023:12)
    at async Server._explodedSourceMapForBundleOptions (node_modules/metro/src/Server.js:971:35)
    at async Promise.all (index 0)
    at async Server._symbolicate (/node_modules/metro/src/Server.js:928:26)
    at async Server._processRequest (node_modules/metro/src/Server.js:394:7)

Can you reproduce the bug?

Always

Reproduction Steps

Version

react version 0.74.1

What services are you using?

Local Database only

Are you using encryption?

No

Platform OS and version(s)

iOS (all versions)

Build environment

Which debugger for React Native: ..

Cocoapods version

1.14.3

sync-by-unito[bot] commented 1 month ago

➤ PM Bot commented:

Jira ticket: RJS-2869