Trouble with async and await in api file

Author: jmcclr1

Originally Sourced from:

I am following a guide to access a cloud database through a document API using js ( My output for the following code is stopping at the await on the find() function for membersCollection (see photo of output below). Here is my code connecting to the API:

const { createClient } = require("@astrajs/collections");

export default async function handler(req, res){
    const astraClient = await createClient({
        astraDatabaseId: process.env.ASTRA_DB_ID,
        astraDatabaseRegion: process.env.ASTRA_DB_REGION,
        applicationToken: process.env.ASTRA_DB_APPLICATION_TOKEN,
    const membersCollection = astraClient.namespace("keyspace").collection("members");
    const members = await membersCollection.find({});

Here is the code for my website.

import Head from 'next/head'
import Image from 'next/image'
import styles from '../styles/Home.module.css'
import { useEffect, useState } from 'react';

export default function Home() {
  const [members, setMembers] = useState([]);

  useEffect(() => {
      .then(response => response.json())
      .then(members => setMembers(members))
  }, []);

  return (
    <div className={styles.container}>
        <title>Create Next App</title>
        <meta name="description" content="Generated by create next app" />
        <link rel="icon" href="/favicon.ico" />

      <main className={styles.main}>
        <h1 className={styles.title}>
          Welcome to JoeHub!

          { => (
            <li key={}>{}, {member.location}, {member.github}</li>

      <footer className={styles.footer}>
          rel="noopener noreferrer"
          Powered by{' '}
          <span className={styles.logo}>
            <Image src="/vercel.svg" alt="Vercel Logo" width={72} height={16} />

Here is my output on the local host: [1]:

Thanks for your help!