Issue: Error during `db:push` - TypeError in Drizzle Kit with PostgreSQL

Hi everyone,

I'm encountering a persistent issue when running the pnpm db:push command to push my PostgreSQL schema using drizzle-kit. The process fails with a TypeError related to replace() in drizzle-kit@0.26.2. Below are the details:

#### Error Output:
$ pnpm db:push

> dotenv drizzle-kit push

No config path provided, using default 'drizzle.config.ts'
Reading config file 'D:\WORK\PEACOCK\A2Z-CARS\a2z-cars-cms\drizzle.config.ts'
Using 'postgres' driver for database querying
[⢿] Pulling schema from database...
D:\WORK\PEACOCK\A2Z-CARS\a2z-cars-cms\node_modules\.pnpm\drizzle-kit@0.26.2\node_modules\drizzle-kit\bin.cjs:19716
              checkValue = checkValue.replace(/^CHECK\s*\(\(/, "").replace(/\)\)\s*$/, "");
                                      ^

TypeError: Cannot read properties of undefined (reading 'replace')
    at D:\WORK\PEACOCK\A2Z-CARS\a2z-cars-cms\node_modules\.pnpm\drizzle-kit@0.26.2\node_modules\drizzle-kit\bin.cjs:19716:39
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Node.js v18.20.4
 ELIFECYCLE  Command failed with exit code 1.


#### My Setup:
  • Drizzle ORM: v0.35.3
  • Drizzle Kit: v0.26.2
  • Postgres: v3.4.4
  • Node.js: v18.20.4
#### Drizzle Config (drizzle.config.ts):
import { env } from "@/env.js";
import { type Config } from "drizzle-kit";

import { database_prefix } from "@/lib/constants";

export default {
  schema: "./src/db/schema/index.ts",
  dialect: "postgresql",
  out: "./drizzle",
  dbCredentials: {
    url: env.DATABASE_URL,
  },
  tablesFilter: [`${database_prefix}_*`],
  verbose: true,
  strict: true,
} satisfies Config;
image.png
Was this page helpful?