question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The dreaded "Missing Realm constructor" still

See original GitHub issue

This is obviously a commonly occurring issue, since you have it linked in the docs. Is this a heisenbug that won’t go away?

I’m only testing integration with import Realm from 'realm'. In iOS simulator, no crash or issue happens. But once built on XCode and run on device, my app would crash on launch, with this XCode console output:

*** Terminating app due to uncaught exception 'RCTFatalException: Unhandled JS Exception: Missing Realm constructor. Did you run "react-native link realm"? Please see https://realm.io/docs/react-native/latest/#missing-realm-constructor for troubleshooting', reason: 'Unhandled JS Exception: Missing Realm constructor. Did you run "react-nativ..., stack:
a@577:484
<unknown>@577:926
n@2:553
<unknown>@371:7765
n@2:553
<unknown>@12:435
n@2:553
i@2:266
global code@600:9
'
*** First throw call stack:
(0x183ec6fe0 0x182928538 0x183ec6f28 0x10017532c 0x10016f758 0x183ecce80 0x183dc22c4 0x183dc6e9c 0x1001731f8 0x1001c0cfc 0x1001c0b68 0x101029a50 0x101029a10 0x1010372e8 0x10102d634 0x101037810 0x101039630 0x10103939c 0x182f87100 0x182f86cac)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb) 

Version of Realm and Tooling

  • Realm JS SDK Version: 1.8.3
  • Node or React Nattive: node 8.1.3, RN 0.46.1
  • Client OS & Version: iOS 10 built on MacOS 10.12.5
  • Which debugger for React Native: None (on device, building from XCode)

I’m also using CocoaPods (for react-native-firebase). I’m seeing some other issues filed that have issue with Pods too, if this is a known pattern that Realm doesn’t play nice with Pods? I’m not linking Realm with Pods FYI, I’m following the docs and linked with react-native link.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:21 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
fungilationcommented, Jul 23, 2017

Does anyone have the problem ?

Me naturally since I first posted this, on RN 0.46.1 (iOS). I haven’t tested again since updating RN, now latest at 0.46.4.

This is a showstopper that needs some TLC.

1reaction
arshbotcommented, Dec 31, 2017

That solution doesn’t work well for defining schemas by extending Realm.Object(). While evaluating, realm isn’t loaded in and the constructor has not defined realm yet, so the value of realm is null. Do you have a solution for that?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Missin Realm Constructor error - MongoDB
Hi, I perfectly followed the instructions that the documentation reported, but every time I start my app it gives me the Missing Realm...
Read more >
Missing Realm constructor. Did you run "pod install"? (I'm ...
I want to use Realm (mongodb). So after running: npm install realm. realm was correctly added in the "node_modules" and I tried to...
Read more >
9.1. Language options — Glasgow Haskell Compiler <release ...
These classes should not “look through” the type or its constructor. You can still derive these classes for a newtype, but it happens...
Read more >
Oceanhorn 2: Knights of the Lost Realm/Nintendo Switch ...
Embark on a journey of magic and technology! A GRAND ADVENTURE Oceanhorn 2: Knights of the Lost Realm, set a thousand years before...
Read more >
Someone else have tried to implement Realm in an Expo ...
Error: Missing Realm constructor. ... the same versions of realm, react-native and expo in my other project is still showing that error, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found