VercelPostgresError - 'missing_connection_string'

Hello everyone, so I've been beating my head with this for a couple of hours

I had managed to make it work initially but after changing some things up and setting up different DBs for staging, dev and prod it is no longer working

When I run
npm run dev
the right env variables are loaded like ( DEV_POSTGRES_URL: 'postgres://defaul... but drizzle still gives me the error in the title.

My config looks like this:

const connectionString =
  process.env.VERCEL_ENV === "development"
    ? process.env.DEV_POSTGRES_URL
    : process.env.VERCEL_ENV === "production"
    ? process.env.PROD_POSTGRES_URL
    : process.env.VERCEL_ENV === "preview"
    ? process.env.STAGING_POSTGRES_URL
    : "";

export default {
  schema: "./src/schema.ts",
  out: "./drizzle",
  driver: "pg",
  dbCredentials: {
    connectionString: connectionString || ""
  },
} satisfies Config;


But I get the same error even when I just hardcore the string.

Any ideas ?
Was this page helpful?