StackBlitz Deployment Logs: Undefined Environment Variables in Vite Builds
0 reputation · 15 Oct 2021, 16:22 UTC
When utilizing the StackBlitz deployment workflow for Vite-based projects, the build process relies on specific environment variable configurations to successfully bundle the application. If a referenced variable is missing or improperly prefixed, the deployment may fail during the build phase.
The current behavior involves streaming build logs to the Deploy tab, where Vite emits warnings when process.env references are undefined. However, there is uncertainty regarding how the "Inject environment variables" toggle in the Deploy Settings UI interacts with the VITE_ prefix requirement for client-side exposure.
- Does the injection toggle bypass the need for the
VITE_prefix for variables intended for the client bundle? - At what stage of the deployment pipeline are missing environment variables validated to prevent a 500 status failure?