Realm js: Expected signal to be an instanceof AbortSignal

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> => {

	const credentials = Realm.Credentials.emailPassword('', '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.

Can you share the error.stack as well? I suspect the error is thrown from this line, but I’d like to be certain.


Thanks for replying, I had problems using electron-forge, I switched to vite js with a configuration for electron and it works without problems when I package the application.

I don’t know if it’s a problem with electron-forge or some webpack configuration or when externalizing react-native debido a que me dio problemas al empquetar tambien.

externals: {
		'react-native': 'react-native',

I don’t know if it’s because of those lines I put in the webpack configuration or if it’s a problem with realm js itself.

I am new to using these technologies, what do you mean by error.stack ?