Skip to content

fix(frontend): rename DEPLOYMENT_TYPE to VITE_DEPLOYMENT_TYPE so it reaches the client bundle#5185

Merged
abcxff merged 1 commit into
mainfrom
06-06-fix_frontend_rename_deployment_type_to_vite_deployment_type_so_it_reaches_the_client_bundle
Jun 6, 2026
Merged

fix(frontend): rename DEPLOYMENT_TYPE to VITE_DEPLOYMENT_TYPE so it reaches the client bundle#5185
abcxff merged 1 commit into
mainfrom
06-06-fix_frontend_rename_deployment_type_to_vite_deployment_type_so_it_reaches_the_client_bundle

Conversation

@abcxff
Copy link
Copy Markdown
Contributor

@abcxff abcxff commented Jun 6, 2026

Description

Please include a summary of the changes and the related issue. Please also include relevant motivation and context.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@railway-app railway-app Bot temporarily deployed to rivet-frontend / rivet-pr-5185 June 6, 2026 19:01 Destroyed
@railway-app
Copy link
Copy Markdown

railway-app Bot commented Jun 6, 2026

🚅 Deployed to the rivet-pr-5185 environment in rivet-frontend

Service Status Web Updated (UTC)
frontend-cloud ✅ Success (View Logs) Web Jun 6, 2026 at 7:03 pm
mcp-hub ✅ Success (View Logs) Web Jun 6, 2026 at 7:02 pm
frontend-inspector 🕒 Building (View Logs) Web Jun 6, 2026 at 7:01 pm
ladle 🕒 Building (View Logs) Web Jun 6, 2026 at 7:01 pm
kitchen-sink 🕒 Building (View Logs) Web Jun 6, 2026 at 7:01 pm
website 🕒 Building (View Logs) Web Jun 6, 2026 at 7:01 pm

Copy link
Copy Markdown
Contributor Author

abcxff commented Jun 6, 2026

This stack of pull requests is managed by Graphite. Learn more about stacking.

@abcxff abcxff marked this pull request as ready for review June 6, 2026 19:02
@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Jun 6, 2026

Code Review

Overview

This PR fixes a real bug: Vite only exposes environment variables to the client bundle when they are prefixed with VITE_. Without that prefix, import.meta.env.DEPLOYMENT_TYPE would always be undefined at runtime, causing getRivetRunUrl to always fall back to the staging URL even in production.

The fix is consistent and complete across all six affected files.


Correctness

  • The rename is correct in all the right places:

    • .env — default value for local dev
    • cloud.Dockerfile and inspector.Dockerfile — Docker ARG DEPLOYMENT_TYPE is still the build-arg name (no change needed there), but the ENV line that surfaces it to Vite is correctly renamed to VITE_DEPLOYMENT_TYPE
    • src/lib/env.ts — schema key renamed to match
    • turbo.json — Turborepo cache key updated to track the renamed var
    • vite.config.ts — the loadEnv-based reference updated
  • The Docker pattern is correct: Docker build args can keep any name; only the ENV var that Vite reads at build time needs the VITE_ prefix.

  • ladle.Dockerfile does not reference DEPLOYMENT_TYPE, so it correctly requires no change.


Minor Nits

  • The ternary reformatting in getRivetRunUrl (removing extra parentheses, adding the trailing semicolon) is a nice cleanup.

  • The PR description is left as the default template with all checkboxes unchecked. It would be helpful to fill in the summary and mark the "Bug fix" box for future reviewers.


No Issues Found

The change is small, targeted, and correct. All call sites have been updated consistently. No test changes are needed because this is a build-time env var configuration fix, not a logic change — but confirming the staging-vs-production URL selection works correctly in a deployed cloud build would fully validate the fix.

@abcxff abcxff merged commit 6b089f6 into main Jun 6, 2026
10 of 17 checks passed
@abcxff abcxff deleted the 06-06-fix_frontend_rename_deployment_type_to_vite_deployment_type_so_it_reaches_the_client_bundle branch June 6, 2026 19:03
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

Successfully merging this pull request may close these issues.

1 participant