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

[Feature] Reflect changes in .env*-files w/o restart #5825

Open
Philzen opened this issue Jun 25, 2022 · 4 comments
Open

[Feature] Reflect changes in .env*-files w/o restart #5825

Philzen opened this issue Jun 25, 2022 · 4 comments

Comments

@Philzen
Copy link
Contributor

Philzen commented Jun 25, 2022

When doing any changes to the .env file, rebuild + reload is not being triggered. When developing more complex generic features that are to be configured via .env*-files, it would be really handy and save a lot of time and effort to be able to have changes reflected w/o having to restart the dev server.

Should be an easy fix, because it is definitely part of the live rebuild + reload, b/c as soon as i change any other file (e.g. any line in any component's code), changes in the .env file become active.

@Philzen Philzen changed the title .env file not watched by dev server .env-file not watched by dev server Jun 25, 2022
@redwoodjs-bot redwoodjs-bot bot added this to Main Jun 26, 2022
@redwoodjs-bot redwoodjs-bot bot moved this to Triage in Main Jun 26, 2022
@dac09
Copy link
Contributor

dac09 commented Jun 26, 2022

Hi @Philzen thanks for raising this!

I think… but am not 100% sure, when you change dotenv files webpack doesn’t pick up the changes until you restart.

While we could certainly do it for the API side easily, it would be a confusing experience if the web and api behave differently. We would need to maintain consistency between both sides, and an unsure of the effort in doing it for the web side.

@joconor
Copy link
Contributor

joconor commented Jun 26, 2022

There’s a basic problem with the use of dotenv/dotenv-defaults by RedwoodJS: They will not overwrite already set environment variables. I’ve filed two separate issues that have this as their root cause, and I expect this will complicate efforts to get any ‘watch’ of .env, .env.defaults correct
See #5785 and #5657
More recent versions of dotenv do have an option to overwrited, but dotenv-defaults uses an older version without that option

@Philzen
Copy link
Contributor Author

Philzen commented Jun 26, 2022

I think… but am not 100% sure, when you change dotenv files webpack doesn’t pick up the changes until you restart.

@dac09 yeah you're right, i must have been mistaken when i opened up the issue, which is now updated accordingly. I guess, until this becomes possible i will have to hard-code and wrap my configs during development.

I’ve filed two separate issues that have this as their root cause

So dunno what the Redwood PMs say. Normally i'd say, close duplicate tickets (which would be this one as it came later), but as this description states it also is a feature / enhancement to the dev experience, so it may be nice to keep and kill three birds with this root cause stone as soon as this is implemented.

@Philzen Philzen changed the title .env-file not watched by dev server [Feature] Reflect changes in .env*-files w/o restart Jun 26, 2022
@jtoar
Copy link
Contributor

jtoar commented Jul 7, 2022

Confirming that changes to .env don't get hot reloaded for either the web or api side. @Philzen it's ok to leave this one open as it's a feature request.

@jtoar jtoar moved this from Triage to Backlog in Main Jul 7, 2022
@jtoar jtoar unassigned dac09 Jul 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backlog
Development

No branches or pull requests

4 participants