Prepared queries typings lost after export in monorepo

I'm using SST and I defined my prepared queries in a separate core package to be used across functions in the functions package.

The prepared queries are defined like that:
// packages/core/db/preparedQueries.ts
import { db } from "@db";
import { sql } from "drizzle-orm";


export const getAccountByUid = db.query.accounts.findFirst({
  where: (accounts, { eq }) => eq(accounts.uid, sql.placeholder('uid')),
}).prepare();


And then imported like this:

// packages/src/db/preparedQueries.ts
import { getAccountByUid } from "@guiderail/core/db/preparedQueries";


in preparedQueries.ts the type is well generated, but upon importing it's imported as any.

Any ideas why it does that?
image.png
image.png
Was this page helpful?