© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Drizzle TeamDT
Drizzle Team•2y ago•
1 reply
ahylianhuman

drizzle-kit overriding `process.env` before `@next/env` can load values

I'm trying to use
drizzle-kit push
drizzle-kit push
using the setup recommended by the Drizzle and Vercel docs, but I am finding that the
drizzle-kit
drizzle-kit
command is performing its own
dotenv
dotenv
loading before my config file can import and use
loadEnvConfig
loadEnvConfig
from
@next/env
@next/env
. This is causing issues if I have an empty value for
POSTGRES_URL
POSTGRES_URL
in
.env
.env
(for documentation purposes) and the actual value in
.env.local
.env.local
(for local development) because
drizzle-kit
drizzle-kit
is unaware of how
@next/env
@next/env
loads environment variables
.

I've worked around this issue by setting by setting
DOTENV_CONFIG_PATH=/dev/null
DOTENV_CONFIG_PATH=/dev/null
, but there should a way to turn this automatic behavior off (or more ideally, make it opt-in instead of opt-out) so it is easier to load environment variables correctly using
@next/env
@next/env
or another
.env
.env
loader of choice.
Drizzle ORM - PostgreSQL
Drizzle ORM is a lightweight and performant TypeScript ORM with developer experience in mind.
Using an ORM to access your Postgres database
Learn how to use your favorite ORM to access your database from your apps
Using an ORM to access your Postgres database
Drizzle TeamJoin
The official Discord for all Drizzle related projects, such as Drizzle ORM, Drizzle Kit, Drizzle Studio and more!
11,879Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

Drizzle-kit can't load env file via t3-env
Drizzle TeamDTDrizzle Team / help
3y ago
drizzle-kit studio reading .env file
Drizzle TeamDTDrizzle Team / help
13mo ago
issue drizzle-kit pull -> drizzle-kit-generate -> drizzle-kit migrations
Drizzle TeamDTDrizzle Team / help
9mo ago
Drizzle Kit
Drizzle TeamDTDrizzle Team / help
15mo ago