Skip to content

fix(web): allow canonical remote dev origins - #1685

Open
lumberman wants to merge 3 commits into
mainfrom
fix/web-tailscale-dev-origin-hydration
Open

fix(web): allow canonical remote dev origins#1685
lumberman wants to merge 3 commits into
mainfrom
fix/web-tailscale-dev-origin-hydration

Conversation

@lumberman

Copy link
Copy Markdown
Collaborator

Summary

  • derive Next.js allowedDevOrigins from the explicitly configured NEXT_PUBLIC_CANONICAL_ORIGIN
  • preserve the existing 127.0.0.1 fallback and tolerate absent or malformed optional values
  • add focused config regression coverage and document the Tailscale hydration failure mode in the roadmap and solutions knowledge base

Why

Next.js 16 blocks development-only HMR and client resources when Forge Web is opened through a Tailscale Serve hostname that is not in allowedDevOrigins. Server-rendered HTML remains visible, but React hydration does not complete and Watch controls are inert.

The fix permits only the hostname from the explicit canonical URL. It does not add a wildcard, hardcode a machine or tailnet address, or change production routing and data access.

Impact

Remote Web QA through an intentional Tailscale hostname can hydrate and execute client-side JavaScript. Normal loopback development continues to work, and malformed optional configuration cannot prevent the Next config from loading.

Validation

  • pnpm --filter @forge/web test -- scripts/allowed-dev-origins.test.mjs — 4 passed
  • pnpm --filter @forge/web lint — passed
  • pnpm --filter @forge/web typecheck — passed
  • full Web suite — 145 files passed, 2,241 tests passed, 2 todo
  • remote browser QA opened and closed the Search dialog with no browser errors or Next.js blocked-origin warning
  • Prettier and git diff --check — passed

Derive allowedDevOrigins from the explicitly configured canonical URL while preserving loopback and malformed-value fallbacks. Add focused config coverage and document the Tailscale hydration diagnosis.
@lumberman
lumberman marked this pull request as ready for review July 22, 2026 18:27
…-origin-hydration

# Conflicts:
#	docs/roadmap/README.md
@railway-app
railway-app Bot temporarily deployed to forge / forge-pr-1685 July 22, 2026 19:24 Destroyed
@railway-app

railway-app Bot commented Jul 22, 2026

Copy link
Copy Markdown

🚅 Deployed to the forge-pr-1685 environment in forge

Service Status Web Updated (UTC)
@forge/web ⏭️ Skipped (View Logs) Jul 22, 2026 at 7:27 pm
@forge/manager ⏭️ Skipped (View Logs) Jul 22, 2026 at 7:24 pm
@forge/agentic-studio ⏭️ Skipped (View Logs) Jul 22, 2026 at 7:24 pm
7 services not affected by this PR
  • @forge/admin/redis
  • @forge/admin/db
  • @forge/agentic-studio
  • @forge/agentic
  • @forge/manager
  • @forge/admin
  • @forge/auth

…-origin-hydration

# Conflicts:
#	docs/roadmap/README.md
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