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.11k stars 610 forks source link

[BUG]:Running yarn build results in a build error... #1280

Closed nt-mino closed 1 year ago

nt-mino commented 1 year ago

What version of drizzle-orm are you using?

0.28.6

What version of drizzle-kit are you using?

0.19.13

Describe the Bug

yarn build
Failed to compile.

./node_modules/drizzle-orm/column-builder.d.ts:35:55
Type error: '?' expected.

  33 |     enumValues: T['enumValues'];
  34 |     baseColumn: T extends {
> 35 |         baseBuilder: infer U extends ColumnBuilderBase;
     |                                                       ^
  36 |     } ? BuildColumn<TTableName, U, 'common'> : never;
  37 | } & {};
  38 | export type ColumnBuilderTypeConfig<T extends ColumnBuilderBaseConfig<ColumnDataType, string>, TTypeConfig extends object = object> = Simplify<{
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Expected behavior

No response

Environment & setup

No response

dankochetov commented 1 year ago

"skipLibCheck": true in tsconfig

nt-mino commented 1 year ago

@dankochetov

"skipLibCheck": true is set in my tsconfig...🤔

{
  "compilerOptions": {
    "target": "es6",
    "lib": ["dom", "dom.iterable", "esnext", "es2021"],
    "allowJs": true,
    "skipLibCheck": true,
    "strict": true,
    "forceConsistentCasingInFileNames": true,
    "noEmit": true,
    "esModuleInterop": true,
    "module": "esnext",
    "moduleResolution": "node",
    "resolveJsonModule": true,
    "isolatedModules": true,
    "jsx": "preserve",
    "incremental": true,
    "baseUrl": ".",
    "paths": {
      "@/*": ["./src/*"]
    }
  },
  "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", "src/**/*"],
  "exclude": ["node_modules"]
}

package.json

{
  "name": "",
  "private": true,
  "scripts": {
    "dev": "next dev",
    "dev:aspida": "aspida --watch",
    "build": "next build",
    "start": "next start",
    "lint": "next lint",
    "db:generate": "yarn drizzle-kit generate:pg --config drizzle.config.ts",
    "db:push": "yarn drizzle-kit push:pg --config drizzle.config.ts",
    "db:drop": "yarn drizzle-kit drop --config drizzle.config.ts",
    "db:factory": "node --require esbuild-register src/postgres/factory.ts"
  },
  "dependencies": {
    "@aspida/fetch": "^1.9.1",
    "@auth0/nextjs-auth0": "^1.7.0",
    "@chakra-ui/icons": "^1.1.5",
    "@chakra-ui/react": "^1.8.3",
    "@chakra-ui/theme-tools": "^1.3.4",
    "@emoji-mart/data": "^1.1.2",
    "@emotion/react": "^11",
    "@emotion/styled": "^11.10.5",
    "@fontsource/m-plus-rounded-1c": "^4.5.0",
    "@fullcalendar/core": "^6.1.1",
    "@fullcalendar/daygrid": "^6.1.1",
    "@fullcalendar/interaction": "^6.1.1",
    "@fullcalendar/react": "^6.1.2",
    "@fullcalendar/timegrid": "^6.1.1",
    "@sendgrid/client": "^7.6.1",
    "@supabase/supabase-js": "^2.36.0",
    "@vercel/edge-config": "^0.1.1",
    "auth0": "^2.40.0",
    "big.js": "^6.2.1",
    "browser-image-compression": "^2.0.0",
    "chart.js": "^4.2.0",
    "chartjs-plugin-doughnutlabel": "^2.0.3",
    "csv-parser": "^3.0.0",
    "date-fns": "^2.29.3",
    "date-fns-tz": "^2.0.0",
    "drizzle-orm": "^0.28.6",
    "emoji-mart": "^5.5.2",
    "encoding-japanese": "^2.0.0",
    "firebase": "^9.13.0",
    "firebase-admin": "^11.3.0",
    "framer-motion": "^5",
    "google-auth-library": "^9.0.0",
    "google-spreadsheet": "^4.0.2",
    "html-react-parser": "^1.4.11",
    "just-clone": "^5.0.1",
    "just-compare": "^2.1.0",
    "just-random": "^3.0.1",
    "just-shuffle": "^4.0.1",
    "just-sort-by": "^3.0.1",
    "microcms-js-sdk": "^2.2.1",
    "next": "12.0.10",
    "next-pwa": "^5.5.2",
    "papaparse": "^5.4.1",
    "postgres": "^3.3.5",
    "react": "17.0.2",
    "react-chartjs-2": "^5.2.0",
    "react-confetti": "^6.1.0",
    "react-cookie": "^4.1.1",
    "react-datepicker": "^4.8.0",
    "react-dom": "17.0.2",
    "react-donut-chart": "^1.3.3",
    "react-hot-keys": "^2.7.2",
    "react-idle-timer": "^4.6.4",
    "react-intersection-observer": "^9.4.1",
    "react-share": "^4.4.1",
    "react-table": "^7.7.0",
    "react-use": "^17.4.0",
    "react-youtube": "^10.1.0",
    "scroll-hint": "^1.2.5",
    "superjson": "^1.8.1",
    "swiper": "^8.0.6",
    "swr": "^1.2.1",
    "ua-parser-js": "^1.0.35"
  },
  "devDependencies": {
    "@types/auth0": "^2.34.13",
    "@types/big.js": "^6.1.6",
    "@types/date-fns": "^2.6.0",
    "@types/emoji-mart": "^3.0.9",
    "@types/encoding-japanese": "^2.0.1",
    "@types/google-spreadsheet": "^4.0.0",
    "@types/node": "17.0.16",
    "@types/papaparse": "^5.3.7",
    "@types/react": "17.0.39",
    "@types/react-datepicker": "^4.8.0",
    "@types/react-html-parser": "^2.0.2",
    "@types/react-table": "^7.7.10",
    "@types/ua-parser-js": "^0.7.36",
    "drizzle-kit": "^0.19.13",
    "esbuild-register": "^3.5.0",
    "eslint": "8.8.0",
    "eslint-config-next": "12.0.10",
    "ts-node": "^10.9.1",
    "typescript": "^5.2.2",
    "worker-loader": "^3.0.8"
  }
}
nt-mino commented 1 year ago

The issue was resolved after I changed the TypeScript version to 4.8.4!