fix(web): allow canonical remote dev origins - #1685
Open
lumberman wants to merge 3 commits into
Open
Conversation
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
marked this pull request as ready for review
July 22, 2026 18:27
…-origin-hydration # Conflicts: # docs/roadmap/README.md
|
🚅 Deployed to the forge-pr-1685 environment in forge
7 services not affected by this PR
|
…-origin-hydration # Conflicts: # docs/roadmap/README.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
allowedDevOriginsfrom the explicitly configuredNEXT_PUBLIC_CANONICAL_ORIGIN127.0.0.1fallback and tolerate absent or malformed optional valuesWhy
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 passedpnpm --filter @forge/web lint— passedpnpm --filter @forge/web typecheck— passedgit diff --check— passed