drizzle-team / drizzle-team/drizzle-orm

[BUG]: Broken typings on Visual Studio Code@1.91.0 using Typescript@5.5

Open
#2,604 18 comments 22 reactions 0 assignees View on GitHub
bug monorepo priority
Dominant language
TypeScript
Stars
35.8k
Forks
1.6k
Avg merge
2d 7h
Merged PRs (30d)
4

Description

### What version of `drizzle-orm` are you using?

0.31.1

### What version of `drizzle-kit` are you using?

0.22.2

### Describe the Bug

After the update of Visual Studio Code to the [latest (1.91.0)](https://github.com/microsoft/vscode/releases/tag/1.91.0) version, typescript started throwing errors like ones below, for every query.
I am working in the nx monorepo, so I had to install typescript in the root of the project and use workspace version of typescript to fix the error messages, but that's just a temporary fix.
By default this version of VSC uses typescript 5.5, everything works fine on 5.4.

![CleanShot 2024-07-08 at 21 01 01@2x](https://github.com/drizzle-team/drizzle-orm/assets/26671956/c8221968-b6e0-49c5-83a1-592670663861)

```
No overload matches this call.
Overload 1 of 3, '(left: Column, object, object>, right: unknown): SQL', gave the following error.
Argument of type 'PgColumn<{ name: "id"; tableName: "deal"; dataType: "string"; columnType: "PgVarchar"; data: string; driverParam: string; notNull: true; hasDefault: true; enumValues: [string, ...string[]]; baseColumn: never; }, {}, {}>' is not assignable to parameter of type 'Column, object, object>'.
Types of property 'table' are incompatible.
Property '[IsDrizzleTable]' is missing in type 'PgTable' but required in type 'Table>>'.
Overload 2 of 3, '(left: Aliased, right: string | SQLWrapper): SQL', gave the following error.
Argument of type 'PgColumn<{ name: "id"; tableName: "deal"; dataType: "string"; columnType: "PgVarchar"; data: string; driverParam: string; notNull: true; hasDefault: true; enumValues: [string, ...string[]]; baseColumn: never; }, {}, {}>' is not assignable to parameter of type 'Aliased'.
Type 'PgColumn<{ name: "id"; tableName: "deal"; dataType: "string"; columnType: "PgVarchar"; data: string; driverParam: string; notNull: true; hasDefault: true; enumValues: [string, ...string[]]; baseColumn: never; }, {}, {}>' is missing the following properties from type 'Aliased': sql, fieldAlias
Overload 3 of 3, '(left: SQLWrapper, right: unknown): SQL', gave the following error.
Argument of type 'PgColumn<{ name: "id"; tableName: "deal"; dataType: "string"; columnType: "PgVarchar"; data: string; driverParam: string; notNull: true; hasDefault: true; enumValues: [string, ...string[]]; baseColumn: never; }, {}, {}>' is not assignable to parameter of type 'SQLWrapper'.
The types returned by 'getSQL()' are incompatible between these types.
Type 'import("/Users/nightspite/Code/polubee/node_modules/.pnpm/drizzle-orm@0.31.1_postgres@3.4.3/node_modules/drizzle-orm/sql/sql").SQL' is not assignable to type 'import("/Users/nightspite/Code/polubee/node_modules/.pnpm/drizzle-orm@0.31.1_react@18.2.0/node_modules/drizzle-orm/sql/sql").SQL'.
Types have separate declarations of a private property 'shouldInlineParams'.ts(2769)
table.d.cts(29, 5): '[IsDrizzleTable]' is declared here.
```

### Expected behavior

No error warnings

### Environment & setup

macos sonoma 14.4.1
vsc 1.91.0
typescript 5.5
node 20
pnpm 8.6.10
nx 19.2.2
eslint 8.55.0

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.