Skip to content

fix(tangent): let a build served from localhost use a local Tangent - #2949

Closed
camielvs wants to merge 1 commit into
cvs/team-run-pagefrom
cvs/tangent-local-build
Closed

camielvs wants to merge 1 commit into
cvs/team-run-pagefrom
cvs/tangent-local-build

Conversation

@camielvs

Copy link
Copy Markdown
Collaborator

Description

A production build served from localhost or 127.0.0.1 now uses a local Tangent the way the Vite dev server does:

  • No Tangent URL on the workspace: it falls back to http://localhost:5173, instead of showing "Tangent isn't configured".
  • A local address on the workspace: it opens it, instead of showing "Tangent is misconfigured".

Both used to depend on import.meta.env.DEV, so only the dev server got them. A production build running locally, such as a Docker image, couldn't open any project against a local Tangent. That build is the only way to test with config a deployment injects into index.html, such as team impersonation.

Deployed origins are unchanged. The guard is there because Chrome prompts for local network access when a page reaches a more private address than its own. Nothing is more private than loopback, so a page served from loopback isn't prompted. A build served from a private IP or a .local name still rejects local addresses, because Chrome would prompt there.

Related Issue and Pull requests

Type of Change

  • Bug fix

Line Breakdown

Category Added Removed
Production code 8 2
Comments 10 7
Tests 78 21
Total 96 30

Checklist

  • I have tested this does not break current pipelines / runs functionality
  • I have tested the changes on staging

Screenshots (if applicable)

None. No UI changes.

Test Instructions

pnpm vitest run src/routes/v2/pages/Tangent

With a Tangent running on localhost:5173, serve a production build from localhost:

  1. Open a project whose workspace has no Tangent URL. It opens against the local Tangent.
  2. Set the workspace's Tangent URL to http://localhost:5173. The project still opens.

On any other host, both still show the same errors as before.

🤖 Generated with Claude Code

Only a Vite dev server fell back to the dev Tangent or accepted a local
Tangent address. A production build served from localhost, such as a
locally run Docker image, refused both, so it could never open a project
against a local Tangent. A loopback page isn't prompted for local network
access, so it now behaves like the dev server. Deployed origins are
unchanged.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

🎩 Preview

A preview build has been created at: cvs/tangent-local-build/829f50d

@camielvs

camielvs commented Oct 26, 2026 •

Copy link
Copy Markdown
Collaborator Author

I found a better solution

@camielvs camielvs closed this Oct 26, 2026
@camielvs
camielvs deleted the cvs/tangent-local-build branch October 30, 2026 22:23
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