-
Notifications
You must be signed in to change notification settings - Fork 115
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
Unable to read non-public environment variables with Vite (Astro) - SSR deployments (specification) #3879
Comments
With a little further testing, it seems I don't need to manually copy E.g. add the |
Passing the environment variables at runtime to the build also does not work on Amplify (but works locally -
The values aren't working at build time at all, whether it's from the .env file (default behaviour) or passed at runtime. I guess the Amplify environment is doing something differently when it comes to building the project with the SSR spec - I can deploy a static site and it works with any serverside variables (without I think another thing to try would be passing it directly to the node command to run the server (which works locally also), but I can't modify this from the deploy manifest e.g. with I have a minimal repo here if you would like to check things and deploy on your end. |
This issue is now closed. Comments on closed issues are hard for our team to see. |
This issue has been automatically locked. |
Before opening, please confirm:
App Id
d2lbl6s4po2urj
AWS Region
us-east-1
Amplify Hosting feature
SSR
Question
Hi I have a Vite based Astro site that I can't get to read a serverside environment variable - the site is built with the SSR specification (
/.amplify-hosting
).Something like this works for PUBLIC starting variables I've set in Amplify's environment variables (no longer needed):
But I can't read non-public variables server-side e.g.:
Everything works fine locally. Appreciate any assistance with this.
The text was updated successfully, but these errors were encountered: