Hi! i am using realm node sdk with electron-forge configuration and also creating an api with contextBridge.
when i load the application in development mode it runs normally but when i copy the application to an electron package i get the following error in the try catch
Expected signal to be an instanceof AbortSignal
this is my configuration where the error occurs
realm js instance
import Realm from 'realm';
import {ProfileSchema} from './schemas';
const OpenRealmBehaviorConfiguration = {
type: 'openImmediately' as any,
};
export const realmApp: Realm.App = new Realm.App({id: 'app id'});
export const getRealm = async (): Promise<Realm> => {
const conn = new Realm({
schema: [ProfileSchema],
sync: {
user: realmApp.currentUser,
partitionValue: 'moises',
newRealmFileBehavior: OpenRealmBehaviorConfiguration,
existingRealmFileBehavior: OpenRealmBehaviorConfiguration,
},
});
return Promise.resolve(conn);
};
user authentication function that is called when using the api I exposed with electron preload
import Realm from 'realm';
import {handleIpcInvokeResponse, ISignInInfo} from '@types';
import {realmApp} from '../Database';
import {logEverywhere} from '../main';
export const signIn = async (user: ISignInInfo): Promise<handleIpcInvokeResponse> => {
console.log(user);
logEverywhere(JSON.stringify(realmApp));
const credentials = Realm.Credentials.emailPassword('email@gmail.com', '1234567');
await realmApp.logIn(credentials);
return Promise.resolve({
success: true,
message: 'Login correcto!',
result: realmApp,
});
};
I would appreciate a reply and thank you in advance.