-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Start.sh doesn't pre-load environment variables anymore - this breaks automatic VITE_* environment variables in frontend #2227
Comments
Hm, were you setting those VITE_ variables using Another thing you may want to do, if you're using VS Code, is to use the VS Code run & debug instead, and add those VITE variables in .vscode/launch.json. I personally avoid using the start scripts, since they're fairly slow to start, don't do hot reloading, etc. |
I set them with I haven't used VS Code run & debug option, but isn't .vscode/launch.json going to remain the same when I switch For now I've just restored the code for env variables in |
Ah, okay, I didn't appreciate that you used them for deployment and vary them per environment. If you want to send a PR for your vite change, we could make that change in the main branch as well. That's reasonable that you need access to VITE_ variables in the frontend. |
@pamelafox I've submitted the PR for this change. |
This issue is for a: (mark with an
x
)Minimal steps to reproduce
start.sh
scriptAny log messages given by the failure
none
Expected/desired behavior
start.sh
script used to import environment variables from azd environment at the beginning. It would be nice to be able to load env values before starting frontend.start.ps1
doesn't have this problem.OS and Version?
Linux Ubuntu 22.04
azd version?
1.11.0
Mention any other details that might be useful
I realize that this behavior is impacting only a customization that I've made in my fork. We are using a few VITE_* variables to change some UI elements depending on the environment we run the application in.
The
start.sh
change was made in PR #1986 to remove an anti-pattern. I'm not asking to revert it, but maybe you can suggest how to load specific environment variables before starting the frontend?Or maybe I'm doing it wrong and should not rely on VITE_* variables at all.
Thanks!
The text was updated successfully, but these errors were encountered: