Cannot read properties of undefined (reading 'connectionString')

In my drizzle.config.ts I have the code:
import type { Config } from "drizzle-kit";
import 'dotenv/config'

export default {
schema: "./lib/db/schema.ts",
out: "./drizzle",
connectionString: process.env.DATABASE_URL,
driver: "mysql2",
} satisfies Config;
import type { Config } from "drizzle-kit";
import 'dotenv/config'

export default {
schema: "./lib/db/schema.ts",
out: "./drizzle",
connectionString: process.env.DATABASE_URL,
driver: "mysql2",
} satisfies Config;
and when I go to run drizzle-kit introspect:mysql I get the error:
TypeError: Cannot read properties of undefined (reading 'connectionString').
TypeError: Cannot read properties of undefined (reading 'connectionString').
I checked my .env.local and DATABASE_URL is defined:
DATABASE_URL='mysql://[email protected]/username?ssl={"rejectUnauthorized":true}'
DATABASE_URL='mysql://[email protected]/username?ssl={"rejectUnauthorized":true}'
2 Replies
Andrii Sherman
you need to put connectionString under dbCredentials field
Want results from more Discord servers?
Add your server