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

[Expo] Realm Errors are not propagated to console #5903

Closed
haikov opened this issue Jun 17, 2023 · 9 comments
Closed

[Expo] Realm Errors are not propagated to console #5903

haikov opened this issue Jun 17, 2023 · 9 comments

Comments

@haikov
Copy link

haikov commented Jun 17, 2023

How frequently does the bug occur?

Always

Description

Hey!

I'm building an app with Expo and Realm, and one of the biggest issues I'm facing with realm is inability to understand what's going wrong in case of issues with schema, query (or anything else related to Realm), since Realm always throws the same error in console which gives no details. The error looks like that:

 ERROR  Error: Exception in HostFunction: <unknown>

This error is located at:
    in Unknown (created by App)
    in Provider (created by App)
    in RCTView (created by View)
    in View (created by GestureHandlerRootView)
    in GestureHandlerRootView (created by App)
    in App (created by RootApp)
    in ReactNativeProfiler (created by RootApp)
    in RCTView (created by View)
    in View (created by __Sentry.TouchEventBoundary)
    in __Sentry.TouchEventBoundary (created by RootApp)
    in RootApp (created by withDevTools(RootApp))
    in withDevTools(RootApp)
    in RCTView (created by View)
    in View (created by AppContainer)
    in RCTView (created by View)
    in View (created by AppContainer)
    in AppContainer
    in main(RootComponent), js engine: hermes

Is this something known or maybe I'm missing some configuration step to make the output cleaner? Or is there some better way to look up the detailed stack trace?

Stacktrace & log output

No response

Can you reproduce the bug?

Always

Reproduction Steps

No response

Version

11.9.0

What services are you using?

Local Database only

Are you using encryption?

No

Platform OS and version(s)

iOS 16

Build environment

Expo SDK 48

Cocoapods version

No response

@kraenhansen
Copy link
Member

I tried but failed to reproduce this. I do see "Exception in HostFunction:", but I get a proper message.
Can you help reproduce this by sharing a minimal repository exhibiting this behaviour?

@sync-by-unito sync-by-unito bot added the Waiting-For-Reporter Waiting for more information from the reporter before we can proceed label Jun 19, 2023
@haikov
Copy link
Author

haikov commented Jun 23, 2023

Tried reproducing it with an example repo, no luck, works as expected there. So it must be something with my project setup. I'm trying to dig into that a bit more and will report back as soon as I get anything. But one more thing which I see when Realm emits an error is this weird log:

Error: ENOENT: no such file or directory, open '/Users/path/to/project/folder/JavaScript'
    at Object.openSync (node:fs:585:3)
    at Object.readFileSync (node:fs:453:35)
    at getCodeFrame (/Users/path/to/project/folder/node_modules/metro/src/Server.js:1004:18)
    at Server._symbolicate (/Users/path/to/project/folder/node_modules/metro/src/Server.js:1073:22)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Server._processRequest (/Users/path/to/project/folder/node_modules/metro/src/Server.js:437:7) {
  errno: -2,
  syscall: 'open',
  code: 'ENOENT',
  path: '/Users/path/to/project/folder/JavaScript'
}

Maybe it rings some bell for you?

@github-actions github-actions bot added Needs-Attention Reporter has responded. Review comment. and removed Waiting-For-Reporter Waiting for more information from the reporter before we can proceed labels Jun 23, 2023
@haikov
Copy link
Author

haikov commented Jun 23, 2023

After installing the same packages from my app to the sample Expo+Realm app I've found that installing @shopify/react-native-skia causes the issue. You can reproduce it by simply adding @shopify/react-native-skia package to @realm/expo-template and then making Relm to crash (for example by removing required property when saving something).

Removing skia from dependencies in my project also resolves the issue there.

Any ideas if this is something on Realm or RN Skia side?

@takameyer
Copy link
Contributor

@haikov We will have to investigate this. Can you try and see if it works with realm at 12.0.0-alpha.2?

@haikov
Copy link
Author

haikov commented Jun 23, 2023

Couldn't run a project successfully with that realm version due to Unable to resolve "bson" from "node_modules/realm/dist/bundle.react-native.mjs"

@kneth
Copy link
Contributor

kneth commented Jul 14, 2023

@haikov I believe the Unable to resolve "bson" issue has been solved in one of our v12 release candidates.

@elle-j
Copy link
Contributor

elle-j commented Jul 14, 2023

@haikov, to add to what @kneth was saying, for your issue with bson, see #5791 which mentions a temporary solution. When #5943 has been merged and released, we believe the issue will be solved.

@takameyer
Copy link
Contributor

I have tested the latest release candidate with Expo 48 and @shopify/react-native-skia installed on both iOS and Android. Everything seems to be working fine.
@haikov have you had a chance to test this again?

@sync-by-unito sync-by-unito bot added Waiting-For-Reporter Waiting for more information from the reporter before we can proceed and removed Needs-Attention Reporter has responded. Review comment. labels Jul 28, 2023
@haikov
Copy link
Author

haikov commented Jul 29, 2023

I can also confirm it is now working fine for those versions. Thank you for looking into that! 🙌

@haikov haikov closed this as completed Jul 29, 2023
@github-actions github-actions bot added Needs-Attention Reporter has responded. Review comment. and removed Waiting-For-Reporter Waiting for more information from the reporter before we can proceed labels Jul 29, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants