Skip to content

fix(frontend): set empty VITE_API_ENDPOINT for production builds#515

Merged
lgelauff merged 1 commit intomontage-devfrom
fix/toolforge-vite-api-endpoint
Apr 20, 2026
Merged

fix(frontend): set empty VITE_API_ENDPOINT for production builds#515
lgelauff merged 1 commit intomontage-devfrom
fix/toolforge-vite-api-endpoint

Conversation

@lgelauff
Copy link
Copy Markdown
Collaborator

Summary

  • Adds frontend/.env.production with VITE_API_ENDPOINT= (empty string)
  • Fixes Toolforge builds broken since Add CORS #277 (Add CORS): without this file, .env is gitignored on Toolforge so VITE_API_ENDPOINT is undefined, making Axios baseURL resolve to undefined/v1/ and breaking all API calls
  • With this fix, production builds correctly use /v1/ as a relative same-domain baseURL

Test plan

  • Build on Toolforge with toolforge jobs run npm-build --image node20 --mem 4Gi --wait --command "cd $HOME/www/python/src/frontend && npm run toolforge:build"
  • Verify no undefined/v1/ errors in browser console
  • Verify login flow works on montage-dev

🤖 Generated with Claude Code

When building on Toolforge, .env is gitignored so VITE_API_ENDPOINT
is undefined, making Axios baseURL resolve to "undefined/v1/" and
breaking all API calls. .env.production sets it to empty so the
baseURL correctly resolves to "/v1/" (same-domain relative path).

Fixes Toolforge deployments broken since #277 (Add CORS).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@lgelauff lgelauff merged commit ceb19e1 into montage-dev Apr 20, 2026
@lgelauff lgelauff deleted the fix/toolforge-vite-api-endpoint branch April 20, 2026 19:58
@lgelauff
Copy link
Copy Markdown
Collaborator Author

Verified working on montage-dev (2026-04-20): built with toolforge jobs run npm-build, no undefined/v1/ errors in browser console, login flow works.

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