Invalid Environment Variables
I am having an issue with accessing my ENVs within my drizzle.config.ts. I'm getting an error about invalid env variables despite them being present and being destructured in the env.mjs
Each ENV is listed in the .env wrapped in single quotes.
10 Replies
More context: it seems the db:push is being registered as trying to use server envs on the client.
Hi, can you paste the error output in a code block?
[email protected] db:push drizzle-kit push:mysql --config=./drizzle.config.ts
Attempted to access a server-side environment variable on the client
, drizzle is set up for the client somehwoThat's awkward. I explicitly don't want to expose my connection string lol
Shouldn't my flag about skipping validation turn this off though?
And I don't it the error on app run, just this function
It has to be an issue with the envs themselves. I prefixed it with Next_Public and I'm still getting the exact same issues.
try deleting node modules and pruning npm/yarn/pnpm store
works for me
Yeah, still no dice.
if it should be public make sure to put it in the client object
The maintainers tell me that I should import the ENV directly using dotenv in the config.
facing same issue