Weird typescript error in a monorepo (pnpm with turborepo)
Argument of type 'PgTableWithColumns<{ name: "users"; schema: undefined; columns: { id: PgColumn<{ name: string; tableName: "users"; dataType: "string"; columnType: "PgUUID"; data: string; driverParam: string; notNull: true; hasDefault: true; ... 6 more ...; generated: undefined; }, {}, {}>; ... 8 more ...; accessCodeSentTo: PgColumn...' is not assignable to parameter of type 'SQL<unknown> | Subquery<string, Record<string, unknown>> | PgViewBase<string, boolean, ColumnsSelection> | PgTable<TableConfig>'.
Type 'PgTableWithColumns<{ name: "users"; schema: undefined; columns: { id: PgColumn<{ name: string; tableName: "users"; dataType: "string"; columnType: "PgUUID"; data: string; driverParam: string; notNull: true; hasDefault: true; ... 6 more ...; generated: undefined; }, {}, {}>; ... 8 more ...; accessCodeSentTo: PgColumn...' is not assignable to type 'PgTable<TableConfig>'.
The types of '.config.columns' are incompatible between these types.
Type '{ id: PgColumn<{ name: string; tableName: "users"; dataType: "string"; columnType: "PgUUID"; data: string; driverParam: string; notNull: true; hasDefault: true; isPrimaryKey: true; isAutoincrement: false; ... 4 more ...; generated: undefined; }, {}, {}>; ... 8 more ...; accessCodeSentTo: PgColumn<...>; }' is not assignable to type 'Record<string, PgColumn<ColumnBaseConfig<ColumnDataType, string>, {}, {}>>'.
Property 'id' is incompatible with index signature.
Type 'PgColumn<{ name: string; tableName: "users"; dataType: "string"; columnType: "PgUUID"; data: string; driverParam: string; notNull: true; hasDefault: true; isPrimaryKey: true; isAutoincrement: false; hasRuntimeDefault: false; enumValues: undefined; baseColumn: never; identity: undefined; generated: undefined; }, {}, ...' is not assignable to type 'PgColumn<ColumnBaseConfig<ColumnDataType, string>, {}, {}>'.
The types of 'table..config.columns' are incompatible between these types.
I cut here cuz max length of discord
1 Reply
This is the code: