Skip to content

fix(database): load database vars from env file#742

Open
klampzlamps wants to merge 1 commit intovercel:mainfrom
klampzlamps:fix/load-database-env
Open

fix(database): load database vars from env file#742
klampzlamps wants to merge 1 commit intovercel:mainfrom
klampzlamps:fix/load-database-env

Conversation

@klampzlamps
Copy link
Copy Markdown

Description

Fix npm run migrate failing with "Connection url is empty" by loading environment variables in the Prisma config

prisma.config.ts reads process.env.DATABASE_URL to configure the datasource, but Prisma CLI does not auto-load .env files when using a TypeScript config. This caused the URL to resolve to an empty string, breaking all migration commands.

Adding import "dotenv/config" ensures the .env file is loaded before the environment variable is accessed.

Related Issues

Closes #738

Checklist

  • My code follows the code style of this project.
  • I have performed a self-review of my code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have updated the documentation, if necessary.
  • I have added tests that prove my fix is effective or my feature works.
  • New and existing tests pass locally with my changes.

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Apr 2, 2026

@klampzlamps is attempting to deploy a commit to the Vercel Team on Vercel.

A member of the Team first needs to authorize it.

@vercel vercel Bot temporarily deployed to Preview – next-forge-storybook April 2, 2026 18:36 Inactive
@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Apr 2, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
next-forge-storybook Skipped Skipped Open in v0 Apr 2, 2026 6:36pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Connection url is empty

1 participant