Back

1.6 Functions -- Missing Param documentId?

  • 0
  • Self Hosted
  • Functions
ZachHandley
20 Sep, 2024, 02:31

So I upgraded my app to 1.6, and it's erroring about "Param documentId is required", but it's just running a createDocument and everything is correct --

TypeScript
Response total: 1
Provider found with $id: 66ecb5c8003b8d67
Creating OAuth request with id: 01J86M33ZHFKD6HDBS3WB72XKR and state: eyJyZWRpcmVjdF91cmkiOiJodHRwczovL29hdXRobWFuYWdlci5zb2NpYWxhaXplLmNvbS9jYWxsYmFjayIsIm9hdXRoUmVxdWVzdElkIjoiMDFKODZNMzNaSEZLRDZIREJTM1dCNzJYS1IiLCJkYXRhYmFzZUlkIjoiZGV2IiwiaXNEZXYiOnRydWUsInVzZXJJZCI6IjAxSjZRQlc2TUsxRlZCR1NNMk1aN1c1QllBIiwidGVhbUlkIjoiMDFKNlFCVzZNSzFGVkJHU00yTVo3VzVCWUEifQ
Creating OAuth request with id: 01J86M33ZHFKD6HDBS3WB72XKR

and then in the error

TypeScript
Error in OAuth process: Param "documentId" is not optional.

-- I'm just running this

TypeScript
this.log(`Creating OAuth request with id: ${id}`);
      await this.databases.createDocument(
        databaseId,
        OAUTH_REQUEST_COLL_ID,
        id,
        {
          providerId: oauthProvider.$id,
          databaseId: databaseId,
          status: "pending",
          state: state,
        }
      );
    }

so I'm confused. The id is clearly defined, the OAUTH_REQUESTS_COLL_ID is a constant, not an env variable, and the databaseId is defined, I logged it earlier in the function, but this is the last place it makes it to.

Updated node-appwrite to ^14.1.0

TL;DR
Developers upgraded their app to version 1.6 and encountered an error stating "Param documentId is required" while calling `createDocument` in Node.js using Appwrite. The issue was resolved by clearing the cache and updating the `node-appwrite` package to version `^14.1.0`.
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