Turso and Drizzle error
drizzle-kit: Please provide required params for "turso" dialect
"Please provide required params for 'turso' dialect: [x] url: undefined" means drizzle-kit loaded drizzle.config.ts and found no value for dbCredentials.url, so it stopped before it connected to Turso. With the config from the Drizzle and Turso docs, url comes from process.env.TURSO_DATABASE_URL. drizzle-kit loads a file named .env and not the .env.local that Next.js apps keep, so the variable is undefined on a laptop that has it only in .env.local, and in CI or a Vercel build step until the project has it. Put the variables in .env, load them in the config with loadEnvConfig from @next/env, or set them in the shell or in Vercel. Reproduced with drizzle-kit 0.31.11 on 2026-10-31.
What the message looks like for migrate and push
The text comes from drizzle-kit's turso credentials check (drizzle-kit/src/cli/validations/libsql.ts), which lists each parameter with its value. The check needs a non-empty url. The authToken is optional, which is why it shows with a question mark. In 0.31.11, migrate printed the turso wording and push printed a shorter one without the dialect name.
$ npx drizzle-kit migrate
Error Please provide required params for 'turso' dialect:
[x] url: undefined
authToken?:
$ npx drizzle-kit push
Error Please provide required params:
[x] url: undefinedWhy does drizzle-kit not see my .env.local?
drizzle-kit's CLI imports dotenv/config (drizzle-kit/src/cli/schema.ts), and in our run a TURSO_DATABASE_URL in a file named .env passed the check while the same line in .env.local did not. Next.js loads .env.local for the app, and its docs say to use @next/env when you need the variables outside the Next.js runtime, such as in an ORM config file. Turso's Drizzle page adds that the config loads variables with dotenv and that frameworks can use their own environment managers instead.
// drizzle.config.ts
import { loadEnvConfig } from '@next/env'
import { defineConfig } from 'drizzle-kit'
loadEnvConfig(process.cwd())
export default defineConfig({
dialect: 'turso',
schema: './db/schema.ts',
out: './migrations',
dbCredentials: {
url: process.env.TURSO_DATABASE_URL!,
authToken: process.env.TURSO_AUTH_TOKEN,
},
})Which database does drizzle-kit migrate change?
The one at dbCredentials.url. A .env that points at a local file: URL migrates that file, not your Turso database, so run the command with the remote URL and its token when you mean production. If you run it in the Vercel build command, the Build Step reads the project's variables, scoped to Production, Preview or Development, and changes reach only new deployments. Because the check treats authToken as optional, a missing token passes it. The failure then comes from the server, as in the HTTP 401 error from @libsql/client.
Checklist
How to fix it, then check the fix
- 01See what the config reads:
grep -nE "dialect|dbCredentials|process.env|dotenv|loadEnvConfig" drizzle.config.ts - 02Use dialect: 'turso' with dbCredentials.url from TURSO_DATABASE_URL and authToken from TURSO_AUTH_TOKEN, as in the Drizzle and Turso docs. A config copied from an older guide may use other names.
- 03Make the values visible to drizzle-kit: keep them in .env, load them with loadEnvConfig as in the second section, or pass them for one run:
TURSO_DATABASE_URL=<database-url> TURSO_AUTH_TOKEN=<token> npx drizzle-kit migrate - 04If the migration runs in the Vercel build command, add both variables in the project settings for Production and Preview, and redeploy.
- 05Run npx drizzle-kit migrate again. It should print "applying migrations" instead of the required params error. Then query a migrated table from the deployed app.
Related
Related guides
Sources
Official docs behind this checklist
Browse all launch guides · Read resources · How to make and check your next change
FAQ
FAQ for builders before launch
Why is authToken marked optional?
drizzle-kit's credentials check requires a non-empty url and accepts a missing authToken, so a local file: database works without one. A remote Turso database needs the token, and a missing one fails later, at the server.
Which commands do I run to apply a migration?
The Drizzle docs generate migrations with npx drizzle-kit generate and apply them with npx drizzle-kit migrate. They also list npx drizzle-kit push, which sends the schema directly.