Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: match next.js env file loading behavior in bin scripts & importConfig, clean up installed packages & mismatching package versions #6601

Merged
merged 29 commits into from
Jun 3, 2024

Conversation

AlessioGr
Copy link
Member

Currently, people would experience errors if they have a .env.local file and run migrate:create, as our loadEnv script previously only checked for .env files, not .env.local files.

Also, this adds loadEnv to importConfig by default, so that we do not have to force people to run and install dotenv for standalone scripts. Just like next automatically handles loading .env files, payload should do so to

Copy link
Member

@denolfe denolfe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's either use the next-env package or emulate all of the functionality.

https://github.com/vercel/next.js/blob/canary/packages/next-env/index.ts

@AlessioGr AlessioGr changed the title fix: ensure .env.local files are automatically loaded in bin scripts and within importConfig fix: match next.js env file loading behavior in bin scripts and within importConfig Jun 3, 2024
@AlessioGr AlessioGr requested a review from denolfe June 3, 2024 17:21
@AlessioGr AlessioGr changed the title fix: match next.js env file loading behavior in bin scripts and within importConfig feat: match next.js env file loading behavior in bin scripts and within importConfig Jun 3, 2024
@AlessioGr AlessioGr changed the title feat: match next.js env file loading behavior in bin scripts and within importConfig feat: match next.js env file loading behavior in bin scripts & importConfig, clean up installed packages & mismatching package versions Jun 3, 2024
@AlessioGr AlessioGr enabled auto-merge (squash) June 3, 2024 20:42
@AlessioGr AlessioGr merged commit 59cde0d into beta Jun 3, 2024
42 of 43 checks passed
@AlessioGr AlessioGr deleted the fix/env-file-loading branch June 3, 2024 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants