Next.js Discord

Discord Forum

Post vercel deployment issues in Prisma/Supabase/Next

Unanswered
African Slender-snouted Crocodil… posted this in #help-forum
Open in Discord
African Slender-snouted CrocodileOP
I am sorry in advance if the post format doesn't comply. I have a full project issue so I do not know what to specifically target. I am also new here and new to these technologies that I am using for the project

I honestly did not have any deployment issue until yesterday. I don't know what happened today, I started getting so many issues. FIrst there is build issue of prisma saying prisma.<model_name>.findMany or count is invalid invocation, then sometimes the website crashes to show application server side or client side exception occured, 504 gateway vercel error

Repo: https://github.com/sparshak7/commerceStop

@prisma/client 5.14.0
prisma 5.14.0

//First problem

export default async function RootLayout({
  children,
}: Readonly<{
  children: React.ReactNode;
}>) {
  const { getPermission, getUser } = getKindeServerSession();

  const [user, requiredPermission] = await Promise.all([
    getUser(),
    getPermission("admin:perm"),
  ]);

// this is where it says prisma.cart.count is invalid invocation
  let cartCount = -1;
  try {
    cartCount =
      user != null
        ? await prisma.cart.count({ where: { kindeAuth: user?.id } })
        : -1;
  } catch (error) {
    console.error(error);
  }

  return (
    //
}

//Second problem

//during build it says prisma.product.findMany is invalid invocation
export async function generateStaticParams() {
  const data = await prisma.product.findMany();

  if (!data) {
    return [];
  }

  return data.map((product) => ({
    id: product.id,
  }));
}


I am very surprised I am getting these issues in Vercel after so long. I have been working on this for a while and never did I face this invocation issue, especially the cart one. I feel very stuck, everything went downhill today

0 Replies