drizzle-team / drizzle-orm

Headless TypeScript ORM with a head. Runs on Node, Bun and Deno. Lives on the Edge and yes, it's a JavaScript ORM too 😅
https://orm.drizzle.team
Apache License 2.0
24.7k stars 652 forks source link

[BUG]: TSC Build Fails #3617

Open brian-lou opened 10 hours ago

brian-lou commented 10 hours ago

Report hasn't been filed before.

What version of drizzle-orm are you using?

0.36.4

What version of drizzle-kit are you using?

0.28.1

Other packages

No response

Describe the Bug

When running tsc or tsc -b or tsc -w in a package during drizzle, tsc reports compile errors such as this one: `../../../node_modules/drizzle-orm/sqlite-core/query-builders/raw.d.cts:27:26 - error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("../../sql/sql.ts")' call instead.

27 typings?: import("../../sql/sql.ts").QueryTypingsValue[]; In total, there are 71 errors in 24 files:Errors Files 1 ../../../node_modules/drizzle-orm/mysql-core/db.d.cts:1 1 ../../../node_modules/drizzle-orm/mysql-core/db.d.ts:1 1 ../../../node_modules/drizzle-orm/mysql-core/query-builders/delete.d.cts:36 1 ../../../node_modules/drizzle-orm/mysql-core/query-builders/delete.d.ts:36 7 ../../../node_modules/drizzle-orm/mysql-core/query-builders/select.d.cts:199 7 ../../../node_modules/drizzle-orm/mysql-core/query-builders/select.d.ts:199 1 ../../../node_modules/drizzle-orm/mysql-core/query-builders/select.types.d.cts:130 1 ../../../node_modules/drizzle-orm/mysql-core/query-builders/select.types.d.ts:130 7 ../../../node_modules/drizzle-orm/mysql-core/utils.d.cts:10 1 ../../../node_modules/drizzle-orm/pg-core/columns/date.common.d.cts:6 1 ../../../node_modules/drizzle-orm/pg-core/query-builders/query.d.cts:23 1 ../../../node_modules/drizzle-orm/pg-core/query-builders/query.d.ts:23 1 ../../../node_modules/drizzle-orm/pg-core/roles.d.cts:7 1 ../../../node_modules/drizzle-orm/pg-core/roles.d.ts:7 13 ../../../node_modules/drizzle-orm/pg-core/utils.d.cts:12 6 ../../../node_modules/drizzle-orm/relations.d.cts:71 1 ../../../node_modules/drizzle-orm/sqlite-core/query-builders/query.d.cts:25 1 ../../../node_modules/drizzle-orm/sqlite-core/query-builders/query.d.ts:25 1 ../../../node_modules/drizzle-orm/sqlite-core/query-builders/raw.d.cts:27 5 ../../../node_modules/drizzle-orm/sqlite-core/query-builders/select.d.cts:202 5 ../../../node_modules/drizzle-orm/sqlite-core/query-builders/select.d.ts:202 1 ../../../node_modules/drizzle-orm/sqlite-core/query-builders/select.types.d.cts:122 1 ../../../node_modules/drizzle-orm/sqlite-core/query-builders/select.types.d.ts:122 5 ../../../node_modules/drizzle-orm/sqlite-core/utils.d.cts:10 Here are my tsconfig compiler options:"compilerOptions": { "target": "ES2022", "module": "nodenext", "moduleResolution": "nodenext", "esModuleInterop": true, "composite": true, "outDir": "./dist", "rootDir": ".", "preserveSymlinks": true, "paths": { ... }, "declaration": true, "declarationMap": true },` This is tsc version 5.6.3

thienscmon commented 8 hours ago

Add "skipLibCheck": true in your tsconfig.json