Skip to content

[bug] Unhandled Promise Rejection: RangeError: Maximum call stack size exceeded. #441

Open
@hut36

Description

Description

Calling powersync.execute() will result in error "Unhandled Promise Rejection: RangeError: Maximum call stack size exceeded.". This is observed only on MacOS 15.2 (and 15.2 beta) and Safari.

Reproduction

  1. Change the code of index.js of powersync-ja/demos/example-vite as below.
  2. pnpm i && pnpm dev
  3. visit localhost:5173 using Safari, open console and you will see the error after some time.
import { column, Schema, Table, PowerSyncDatabase } from '@powersync/web';
import Logger from 'js-logger';

Logger.useDefaults();

/**
 * A placeholder connector which doesn't do anything.
 * This is just used to verify that the sync workers can be loaded
 * when connecting.
 */
class DummyConnector {
	async fetchCredentials() {
		return {
			endpoint: '',
			token: ''
		};
	}

	async uploadData(database) {}
}

const customers = new Table({ name: column.text })
export const AppSchema = new Schema({ customers });

let PowerSync;

const openDatabase = async () => {
	PowerSync = new PowerSyncDatabase({
		schema: AppSchema,
		database: { dbFilename: 'test.sqlite' }
	});

	await PowerSync.init();
	//await PowerSync.connect(new DummyConnector());
};

document.addEventListener('DOMContentLoaded', async (event) => {
	await openDatabase();

	let name = 0;
	while (name < 10000) {
		console.log('name: ', name);
		await PowerSync.execute('INSERT INTO customers(id, name) VALUES(uuid(), ?)', [`${name}`]);
		name += 1;
	}
});

Additional Info

Platform: MacOS 15.2 x86_64
@powersync/web: 1.12.1

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions