RangeError: Maximum call stack size exceeded on update and delete for small number of rows (10s)

I have the following two calls that return the same RangeError:

 await db
    .update(schema.cards)
    .set({ redeemable: true })
    .where(eq(schema.cards.contractAddress, vaultAddress))
    .returning({ address: vaultAddress })
    .catch((error) => {
      console.error(error);
      error(500);
    });

await db
    .delete(schema.cards)
    .where(
      and(
        eq(schema.accounts.address, address),
        eq(schema.cards.contractAddress, vaultAddress),
      ),
    )
    .returning({ address })
    .catch((error) => {
      console.error(error);
      error(500);
    });

The number of rows in question is around 10. I am successfully using .where with update in another query.
Was this page helpful?