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

.env.{stage} not being picked up during sst dev #803

Closed
kmcaloon opened this issue Aug 2, 2024 · 2 comments
Closed

.env.{stage} not being picked up during sst dev #803

kmcaloon opened this issue Aug 2, 2024 · 2 comments
Assignees

Comments

@kmcaloon
Copy link

kmcaloon commented Aug 2, 2024

I have a NextJS app that needs to use some sst resources. When running sst dev -- next dev everything looks good, except it looks like sst.config.ts is only picking up environment variables from .env. Any other files like .env.local never get loaded. When I remove .env, sst then throws an error because the variables are missing.

From what I understand, is it not supposed to automatically work with .env.{stage} files?

@jayair
Copy link
Contributor

jayair commented Aug 2, 2024

I don't know if we properly supported this yet.

EDIT: I tested this with sst dev and sst deploy and it worked. Make sure your stage name matches the stage you are running on.

Screenshot 2024-08-02 at 5 10 49 PM

@kmcaloon
Copy link
Author

kmcaloon commented Aug 6, 2024

Ok thanks @jayair. I thought I had tried explicitly setting the stage. We ended up not actually needing it but I'm sure we'll need this functionality soon.

@kmcaloon kmcaloon closed this as completed Aug 6, 2024
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

No branches or pull requests

3 participants