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

[React Native] TypeError: Cannot read property 'size' of undefined #6954

Open
guillemsarda opened this issue Jan 8, 2025 · 1 comment
Open

Comments

@guillemsarda
Copy link

How frequently does the bug occur?

Always

Description

The app crashes on fresh install because of a problem in the Results.js file.

Stacktrace & log output

Warning: TypeError: Cannot read property 'size' of undefined

Can you reproduce the bug?

Always

Reproduction Steps

Our project was built using:

  • react-native: 0.71.2
  • realm: 11.9.0
  • @realm/react: 0.4.3

And had two schemas with no relation between them.

After upgrading to the latest versions of all the packages, the app crashed on runtime giving the following output:
Warning: TypeError: Cannot read property 'size' of undefined.

The issue has been solved by going to the Results.js file in the dist folder and updating the getter length to this:
get length() { return this.internal ? this.internal.size() : 0; }

Version

12.14.0

What services are you using?

Local Database only

Are you using encryption?

Yes

Platform OS and version(s)

iOS and Android, all versions

Build environment

  • "react-native": "^0.76.2"
  • "@react-native/metro-config": "0.76.5"
  • "@realm/react": "^0.11.0"
  • "realm": "^12.14.0"
  • Node version: 18.17.1
  • Android env:
    • ndkVersion: "26.1.10909125"
    • kotlinVersion: "1.9.24"
    • buildToolsVersion = "35.0.0"
    • minSdkVersion = 24
    • compileSdkVersion = 35
    • targetSdkVersion = 34
  • iOS env:
    • Minimum version: 13.0
    • Swift version: 5.0
    • Cocoapods version: 1.15.2

Cocoapods version

1.15.2

@kraenhansen
Copy link
Member

Please provide exact steps or ideally a minimal repo with code reproducing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants