TypeScript error in monorepo suddenly appearing

I have the following Drizzle statement:

const res = await db
        .select()
        .from(users)
        .leftJoin(usersCompaniesRole, eq(users.id, usersCompaniesRole.userId))
        .leftJoin(company, eq(usersCompaniesRole.companyId, company.id))
        .leftJoin(roles, eq(usersCompaniesRole.roleId, roles.id));


Which has started giving me this TS error for the arguments passed to the eq functions:

Type 'import("/mg-monorepo/node_modules/.pnpm/drizzle-orm@0.30.7_@types+pg@8.11.0_@types+react@18.2.74_react@18.2.0/node_modules/drizzle-orm/sql/sql").SQL<unknown>' is not assignable to type 'import("/mg-monorepo/node_modules/.pnpm/drizzle-orm@0.30.7_@types+pg@8.11.0_pg@8.11.3_postgres@3.4.3/node_modules/drizzle-orm/sql/sql").SQL<unknown>'.


I have a db package and an
app
package. Both are using the same version of Drizzle (0.30.7)

Can someone please help me work out what is causing this?
Was this page helpful?