fix: update database commands in package.json to include dotenv for local development #2065
Open
heyy-kartik wants to merge 1 commit intoMail-0:stagingfrom
Open
fix: update database commands in package.json to include dotenv for local development #2065heyy-kartik wants to merge 1 commit intoMail-0:stagingfrom
heyy-kartik wants to merge 1 commit intoMail-0:stagingfrom
Conversation
…ocal development fix: add localhost backend port for local development in auth.ts fix: correct valkey image reference in docker-compose.db.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix: add localhost backend port for local development in auth.ts
fix: correct valkey image reference in docker-compose.db.yaml
Description
Ensure drizzle-kit loads environment variables from .dev.vars
This PR fixes an issue where running pnpm db:push or pnpm db:generate inside the server workspace fails because drizzle-kit
doesn't automatically load the DATABASE_URL from Cloudflare's .dev.vars file.
Why is this needed?
By prefixing the database scripts with dotenv -e .dev.vars, we guarantee that Drizzle always has the correct database connection string available during local setup and schema migrations
Type of Change
Please delete options that are not relevant.
Areas Affected
Please check all that apply:
Security Considerations
For changes involving data or authentication:
Checklist
Additional Notes
During my initial local development setup, I got completely stuck because the database container initialized with the default
postgrespassword, but the Drizzle migrations (pnpm db:push) were failing silently or throwing500 Internal Server Errorand missing relation errors because drizzle-kit wasn't picking up theDATABASE_URLfrom .dev.vars. Once I explicitly passed the environment variables usingdotenv-cli, the schema pushed perfectly and the authentication errors disappeared.By submitting this pull request, I confirm that my contribution is made under the terms of the project's license.