ERROR: prepared statement "s9656" does not exist

Not sure why I'm getting this because I have no prepared statement.

I thought it might have been a bug with relational queries so I tried a regular select too. Both of these result in the same error.

import { db } from "drizzle";
import { eq } from "drizzle-orm";
import { fineTunesTable } from "drizzle/schema";

export async function GET(request: Request) {
  try {
    const { searchParams } = new URL(request.url);
    const projectId = searchParams.get("projectId");
    // const fineTunes = await db.query.fineTunesTable.findMany({
    //   where: eq(fineTunesTable.projectId, Number(projectId)),
    // });
    const fineTunes = await db
      .select()
      .from(fineTunesTable)
      .where(eq(fineTunesTable.projectId, Number(projectId)));
    return new Response(JSON.stringify(fineTunes), { status: 200 });
  } catch (error) {
    console.error("An error occurred:", error);
    return new Response(JSON.stringify("An error occurred"), { status: 500 });
  }
}


And just as proof, here's a screen shot of my axiom logs showing this error with the API route as well as a screen shot of the file so you know I'm getting this error from this code specifically.

Anyone have any idea what could be going on?
image.png
SCR-20230904-q7.png
Was this page helpful?