swessel
swessel
DTDrizzle Team
Created by Ransom on 8/11/2023 in #help
Type error: Type parameter has a circular constraint
I'm using a monorepo without nextjs my setup: "typescript": "^5.1.6" "mysql2": "^3.6.0", "drizzle-orm": "^0.28.2", "zod": "^3.21.4" and tried with node 18 and 20 I did not open a github issue yet, as I was come across this thread here via google
17 replies
DTDrizzle Team
Created by Ransom on 8/11/2023 in #help
Type error: Type parameter has a circular constraint
Thanks, this worked for me too. Yes, it's not ideal, but it is a workaround for now. But now I'm able to build again at all. I think it will be fixed in one of the next releases.
17 replies
DTDrizzle Team
Created by Ransom on 8/11/2023 in #help
Type error: Type parameter has a circular constraint
Errors Files
1 node_modules/drizzle-orm/column.d-04875079.d.ts:273
2 node_modules/drizzle-orm/select.types.d-b0925107.d.ts:298
Errors Files
1 node_modules/drizzle-orm/column.d-04875079.d.ts:273
2 node_modules/drizzle-orm/select.types.d-b0925107.d.ts:298
17 replies
DTDrizzle Team
Created by Ransom on 8/11/2023 in #help
Type error: Type parameter has a circular constraint
node_modules/drizzle-orm/select.types.d-b0925107.d.ts:385:15 - error TS18052: Non-abstract class 'MySqlSelect<TTableName, TSelection, TSelectMode, TPreparedQueryHKT, TNullabilityMap>' does not implement all abstract members of 'MySqlSelectQueryBuilder<MySqlSelectHKT, TTableName, TSelection, TSelectMode, TNullabilityMap>'

385 declare class MySqlSelect<TTableName extends string | undefined, TSelection, TSelectMode extends SelectMode, TPreparedQueryHKT extends PreparedQueryHKTBase, TNullabilityMap extends Record<string, JoinNullability> = TTableName extends string ? Record<TTableName, 'not-null'> : {}> extends MySqlSelectQueryBuilder<MySqlSelectHKT, TTableName, TSelection, TSelectMode, TNullabilityMap> {
~~~~~~~~~~~

node_modules/drizzle-orm/select.types.d-f5caa4d6.d.ts:9:14
9 abstract getSQL(): SQL;
~~~~~~
Non-abstract class 'MySqlSelect<TTableName, TSelection, TSelectMode, TPreparedQueryHKT, TNullabilityMap>' does not implement inherited abstract member 'getSQL' from class 'MySqlSelectQueryBuilder<MySqlSelectHKT, TTableName, TSelection, TSelectMode, TNullabilityMap>'.
node_modules/drizzle-orm/select.types.d-b0925107.d.ts:385:15 - error TS18052: Non-abstract class 'MySqlSelect<TTableName, TSelection, TSelectMode, TPreparedQueryHKT, TNullabilityMap>' does not implement all abstract members of 'MySqlSelectQueryBuilder<MySqlSelectHKT, TTableName, TSelection, TSelectMode, TNullabilityMap>'

385 declare class MySqlSelect<TTableName extends string | undefined, TSelection, TSelectMode extends SelectMode, TPreparedQueryHKT extends PreparedQueryHKTBase, TNullabilityMap extends Record<string, JoinNullability> = TTableName extends string ? Record<TTableName, 'not-null'> : {}> extends MySqlSelectQueryBuilder<MySqlSelectHKT, TTableName, TSelection, TSelectMode, TNullabilityMap> {
~~~~~~~~~~~

node_modules/drizzle-orm/select.types.d-f5caa4d6.d.ts:9:14
9 abstract getSQL(): SQL;
~~~~~~
Non-abstract class 'MySqlSelect<TTableName, TSelection, TSelectMode, TPreparedQueryHKT, TNullabilityMap>' does not implement inherited abstract member 'getSQL' from class 'MySqlSelectQueryBuilder<MySqlSelectHKT, TTableName, TSelection, TSelectMode, TNullabilityMap>'.
17 replies
DTDrizzle Team
Created by Ransom on 8/11/2023 in #help
Type error: Type parameter has a circular constraint
In addition to you'r mentioned issue, I also get:
node_modules/drizzle-orm/column.d-04875079.d.ts:465:22
465 type TableConfig$2 = TableConfig$3<MySqlColumn>;
~~~~~~~~~~~~~~~~~~~~~~~~~~
Circularity originates in type at this location.

node_modules/drizzle-orm/select.types.d-b0925107.d.ts:298:15 - error TS2420: Class 'MySqlDelete<TTable, TQueryResult, TPreparedQueryHKT>' incorrectly implements interface 'SQLWrapper'.
Property 'getSQL' is missing in type 'MySqlDelete<TTable, TQueryResult, TPreparedQueryHKT>' but required in type 'SQLWrapper'.

298 declare class MySqlDelete<TTable extends AnyMySqlTable, TQueryResult extends QueryResultHKT, TPreparedQueryHKT extends PreparedQueryHKTBase> extends QueryPromise<QueryResultKind<TQueryResult, never>> implements SQLWrapper {
~~~~~~~~~~~

node_modules/drizzle-orm/column.d-04875079.d.ts:87:5
87 getSQL(): SQL;
~~~~~~~~~~~~~~
'getSQL' is declared here.
node_modules/drizzle-orm/column.d-04875079.d.ts:465:22
465 type TableConfig$2 = TableConfig$3<MySqlColumn>;
~~~~~~~~~~~~~~~~~~~~~~~~~~
Circularity originates in type at this location.

node_modules/drizzle-orm/select.types.d-b0925107.d.ts:298:15 - error TS2420: Class 'MySqlDelete<TTable, TQueryResult, TPreparedQueryHKT>' incorrectly implements interface 'SQLWrapper'.
Property 'getSQL' is missing in type 'MySqlDelete<TTable, TQueryResult, TPreparedQueryHKT>' but required in type 'SQLWrapper'.

298 declare class MySqlDelete<TTable extends AnyMySqlTable, TQueryResult extends QueryResultHKT, TPreparedQueryHKT extends PreparedQueryHKTBase> extends QueryPromise<QueryResultKind<TQueryResult, never>> implements SQLWrapper {
~~~~~~~~~~~

node_modules/drizzle-orm/column.d-04875079.d.ts:87:5
87 getSQL(): SQL;
~~~~~~~~~~~~~~
'getSQL' is declared here.
17 replies
DTDrizzle Team
Created by Ransom on 8/11/2023 in #help
Type error: Type parameter has a circular constraint
👍 Ohhh, thank's! Yes, that fixed the issue.
17 replies
DTDrizzle Team
Created by Ransom on 8/11/2023 in #help
Type error: Type parameter has a circular constraint
have similar issues. Also, some strange issues relating to zod happen. For example a schema like z.object({ key: z.string() }) becomes a type of { key?: string} - the object keys become optional in type definitions.
17 replies