Back

TypeError: Cannot read properties of undefined (reading 'client')

  • 0
  • Web
ArnabChatterjee20k|Mentor
3 Aug, 2023, 16:06

I am trying to debounce the update method. Here is the code

TypeScript
  reOrderCol() {
    const recentColumn = { current: [] };
    const update = this.db.updateDocument
    const dbId = this.dbId
    const boardsId = this.boardsId
    async function reOrderColDriver(board_db_id, newOrder) {
      debugger
      recentColumn.current = newOrder;
      setTimeout(async () => {
        console.log(update);
        if (recentColumn.current.length !== 0) {
          console.log("🚀 ~ file: API.js:134 ~ API ~ reOrderCol ~ dbId:", dbId,boardsId)
          const res = await update(
            dbId,
            boardsId,
            board_db_id,
            {
              order: newOrder,
            }
          );
          console.log({ res });
        }
      }, 200);
    }
    return reOrderColDriver
  }
}
TL;DR
The code is causing a `TypeError` because it is trying to read the property `client` of an undefined object. The `client` property is not present in the code provided. The code is attempting to debounce the `update` method. There is no solution provided in the thread.
Binyamin
3 Aug, 2023, 16:07

I don't see any client in this code

Binyamin
3 Aug, 2023, 16:07

It's in the update function?

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more