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.

Error when require Realm in react native app

See original GitHub issue

After installing realm in a react native project and require it just like the documentation example

const Realm = require('realm');

the app just doesn’t launch anymore. As soon as i remove the require, app launch normaly.

My dependencies :

"react": "16.0.0-beta.5",
"react-native": "^0.49.5",  
"react-native-maps": "^0.17.1", 
"react-redux": "^5.0.6", 
"realm": "^2.0.8", 
"redux": "^3.7.2"

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:12 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
knethcommented, Jun 1, 2018

@jaumevn Thanks for the update. global.self = global feels like a hack 😄. And from the linked issue, it does sound that it doesn’t work in all cases. Adding the hack to our documentation sounds like a good idea.

1reaction
OceanHorncommented, Nov 21, 2017

I met the same question half a month ago and found an answer this night. But it’s too late tonight, I will share tomorrow.

Read more comments on GitHub >

github_iconTop Results From Across the Web

React-Native app "keeps stopping" after installing realm and ...
when I run npm uninstall realm @realm/react the app build and lunch ... ERROR Error: Requiring module "src\navigation\stack\index.js", ...
Read more >
Error when require Realm in react native app - Stack Overflow
I'm integrating Realm in my react native project and I get an error when I use the import statement defined on the realm...
Read more >
React-Native errors when using realm - MongoDB
I am trying to set up an electron app with angular 14. Module not found: Error: Can't resolve 'react-native' in {Path_To_App}\node_modules\ ...
Read more >
@realm/react - npm
Realm React. Build better apps, faster. Introduction. Setting up Realm in a React Native application has historically been complex.
Read more >
Troubleshooting - React Native
These are some common issues you may run into while setting up React Native. If you encounter something that is not listed here, ......
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