realm-js: [Bug]: realmConstructor.Sync._initializeSyncManager is not a function
Goals
Resolve realmConstructor.Sync._initializeSyncManager
is not a function error that occurs while trying to use React Native debugger
Expected Results
A user should be able to debug React Native App using React Native debugger tools (Chrome based).
Actual Results
Error:
realmConstructor.Sync._initializeSyncManager is not a function
handleException @ ExceptionsManager.js:76
handleError @ InitializeCore.js:69
reportFatalError @ error-guard.js:42
guardedLoadModule @ require.js:209
metroRequire @ require.js:136
(anonymous) @ bundle.umd.js:1
executeApplicationScript @ RNDebuggerWorker.js:1
t @ RNDebuggerWorker.js:1
Steps to Reproduce
react-native init AwesomeApp
yarn add realm
react-native link realm
react-native run-ios
Code Sample
I used an example from your documentation
import Realm from 'realm';
const CarSchema = {
name: 'Car',
properties: {
make: 'string',
model: 'string',
miles: { type: 'int', default: 0 },
},
};
const realm = new Realm({ schema: [CarSchema] });
export const queryCars = () => {
return realm.objects('Car');
};
export const addCar = () => {
realm.write(() => {
const myCar = realm.create('Car', {
make: 'Honda',
model: 'Civic',
miles: 1000,
});
myCar.miles += 20; // Update a property value
});
};
export default realm;
Version of Realm and Tooling
- Realm JS SDK Version: 2.20.0
- Node or React Native: React Native - 0.57.5
- Client OS & Version: MacOS - Mojave
- Which debugger for React Native: React Native Debugger (Chrome based)
Temporary Solution:
Commeting out this line worked but this is not the best solution:
Path: node_modules/realm/lib/index.js
comment out this line:
realmConstructor.Sync._initializeSyncManager(createUserAgentDescription());
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 17
- Comments: 17 (3 by maintainers)
@kaoDev Hopefully today.
I updated to 2.20.1 and it still appears. @bmunkholm
That’s weird. We will have to look at that again then. @cmelchior
i have this bug too