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

RangeError: number is not integral, js engine: hermes #6190

Closed
angelos3lex opened this issue Oct 10, 2023 · 4 comments
Closed

RangeError: number is not integral, js engine: hermes #6190

angelos3lex opened this issue Oct 10, 2023 · 4 comments

Comments

@angelos3lex
Copy link

angelos3lex commented Oct 10, 2023

How frequently does the bug occur?

Sometimes

Description

There is a crash when I'm doing a creation in the db. Seems like it doesn't happen everytime, maybe around 80%, or maybe has something to do with specific data, i haven't yet concluded where the error begins.
This is happening now as I updated realm and react native, didn't use hermes before.

The creation is happening inside a transaction as i have called beginTransaction and then i call:

this._realm.beginTransaction();
this._realm.create(schema, obj, Realm.UpdateMode.All)
this._realm.commitTransaction();

I get the following error:
RangeError: number is not integral, js engine: hermes

This is happening on android (I haven't yet tested iOS)
with: Realm 12.2.0, hermes and RN 0.72.5

Stacktrace & log output

numToInt 
  bundle.react-native.js:649:18
anonymous
  bundle.react-native.js:4334:42
anonymous
  bundle.react-native.js:3749:40
set
  bundle.react-native.js:4127:24
create
  bundle.react-native.js:4717:41
create
  bundle.react-native.js:9653:45

Can you reproduce the bug?

Sometimes

Reproduction Steps

Will update further while i follow more the crash, as the schema is huge and cant provide as is for now.
Any ideas/hints for now on how to proceed debugging?

Version

12.2.0

What services are you using?

Local Database only

Are you using encryption?

No

Platform OS and version(s)

android (tested on 13 & 10, happens on both)

Build environment

No response

Cocoapods version

No response

@angelos3lex
Copy link
Author

angelos3lex commented Oct 10, 2023

Update1: the value that it tried to convert to Int on last crash: 2707.0110000000004

Update2: the field where i try to save this value is an int field, not a double as the value indicates it should be.
So 2 things may happen. Either on previous RN+realm versions i did give a correct int value instead of a double (weird), or realm was guarding me silently from this error in previous version and saved just the int part? Did you have such a behavior in realm 10.10.1 (that was my prev realm)?

@angelos3lex
Copy link
Author

I verify that on previous realm the double was automatically transformed by realm to int and saved successfully to the database. I'm closing this issue as we can fix this on our end, no reason to ask to keep same automatic transformation.

@mklb
Copy link

mklb commented Oct 16, 2023

I can confirm this. I use Math.trunc() now

@joseluishaddad
Copy link

I am having the same issue with realm 12.5.1 on iOS

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 14, 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

3 participants