Watch keynotes and sessions from MongoDB.live, our virtual developer conference.

Fresh Setup: Realm React Native Error: Unable to resolve module `./subscription` from `node_modules/realm/lib/browser/index.js`

Hi guys,

So I am trying to build my first MongoDB/Realms App - a colleague already used Realms before it got acquired by MongoDB and only told me great things about it.

Weird thing is, I cant even get started. :frowning_face:

Setup:

  • XCode 11.3.1
  • CocoaPods 1.9.3
  • React, React Native, … most current versions
  • Realm ^10.0.0-beta.6

When I do everything as explained here, and start the simulator from XCode, the first page already immediately throws the following error:

Error: Unable to resolve module `./subscription` from `node_modules/realm/lib/browser/index.js`

Weird thing is: in node_modules/realm/lib/browser/index.js I can not find anything related to subscription anywhere.

Please help guys, I am completely stuck here.

cheers, Patrick

Hi Patrick -

I was able to get realm working with React Native with the following environment.

  • Xcode 11.5
  • Cocoa Pods 1.9.1
  • Realm ^10.0.0-beta.6
  • Node v10 (using nvm use 10)

And then doing:

  1. npm install realm@v10.0.0-beta.6
  2. pod install
  3. npm start
  4. Running my simulator from my XCode workspace ( .xcodeworkspace)
1 Like