.then is not a function error when making query

Unhandled Rejection (TypeError): result.then is not a function

const getEmail = async (userId) => {
  const query = new moralis.Query(moralis.User);
  const result = await query.get(userId);
  const email = result.then((user) => {
    return user.get("email");
  });
  return email;
};

because you use await you dont need .then()
I suggest you learn more about how await works

Check this video:
https://www.youtube.com/watch?v=568g8hxJJp4

To solve your problem - remove await

2 Likes