Skip to content
Init is coming / May 19 - 23
Back

Appwrite Bun 1.0 function runtime error

  • 0
  • Self Hosted
  • Functions
  • Web
Vineet
16 Feb, 2025, 04:03

Could not list users: axios is not a function. (In 'axios(options)', 'axios' is an instance of Module)

TypeScript
const validateUser = async (client: Client, userId : string) => {
    const users = new Users(client)
    const user = await users.get(userId)
    if (!user) {
        return  {
            code: 400,
            message: 'User not found',
        }
    }

    return {
        code: 200,
        message: "User exists, Proceeding with function execution"
    }
}

Can someone help me out with this issue ? Is there a bug with the node appwrite package ?

TL;DR
Issue: Error "axios is not a function" in Appwrite Bun 1.0 function. Solution: The error is due to using "axios" incorrectly. Make sure to import and use axios properly in your code. Explanation: The code snippet provided does not show any usage of axios. Double-check your code for proper axios implementation.
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