Importing Realm returns the error "Undefined is not a constructor (evaluating 'new XMLHttpRequest')"
See original GitHub issueGoals
Import Realm into a React Native project.
Expected Results
I should be able to import Realm and run the project in iOS with crashing.
Actual Results
The app crashes in release mode completely. The app crashes in debug mode if not using Chrome Debugger and I get this error on the screen:
Undefined is not a constructor (evaluating 'new XMLHttpRequest')
I get this repeating error in the console
"Must first create RPC session with a valid host".
Steps to Reproduce
I’m trying to import Realm into my React Native project and run in iOS. I’ve installed the npm and linked it. It crashes when I add the following line:
import Realm from 'realm';
Version of Realm and Tooling
- Realm JS SDK Version: 2.4.1
- Node or React Native: RN v0.46.2
- Client OS & Version: Mac OSX 10.13.4
- Which debugger for React Native: Xcode v9.3
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:31 (8 by maintainers)
Top Results From Across the Web
TypeError: undefined is not a constructor (evaluating 'new ...
I am trying to add firebase auth to my mobile application using this link to support phone number authentication. A minimal version of...
Read more >undefined is not a constructor evaluating new XMLHttpRequest
Hi, for a project with Dynamics 365 Online version 8.2, I wrote a JS script which runs on the Order Entity, performs a...
Read more >receiving [TypeError: undefined is not an object (evaluating ...
Have been trying to use starter code from the RN tutorial and have not successfully pushed a new document to local Realm DB...
Read more >TypeError: undefined is not a constructor react-native
Answers: “undefined is not a constructor” is an error message PhantomJS displays when you try to call a function that is not defined....
Read more >Safari Technology Preview Release Notes - Apple Developer
currentSrc to not get reset when a new load error occurs (251654@main) ... in import rules can not be reordered on media query...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
seeing this issue as well w/ RN 0.59
By the way, something similar happens on Android. This message is iOS only but here is the error for both platforms :
undefined is not a constructor (evaluating 'new XMLHttpRequest()')
makeRequest - rpc.js:204:22
Can't find variable : Symbol
<unknown> - constants.js:30:24