Skip to content

Avoid cross-origin RSC prefetch errors for homepage demo links #1012

Description

@ShenzheZhu

Target branch

main

Classification

Frontend regression gap / production console error

Problem

The marketing homepage renders demo links as relative /documents/new?demo=1 URLs. On writehumanly.net, Next.js attempts an RSC prefetch on the marketing origin, which redirects to app.writehumanly.net and logs Failed to fetch RSC payload before falling back to full browser navigation.

Expected behavior

Production homepage demo links should point directly at the product app origin so they navigate without a failed RSC prefetch. Local development should retain relative links.

Reproduction

  1. Open https://writehumanly.net/.
  2. Inspect browser console while the page prefetches the Demo links.
  3. Observe Failed to fetch RSC payload for https://writehumanly.net/documents/new?demo=1.

Suspected failure path

packages/frontend-user/src/app/page.tsx defines fastDemoHref as a relative URL instead of using the existing productAppHref origin helper.

Scope

  • Route homepage demo links through productAppHref.
  • Add a focused source-level regression test if an existing page test covers link targets.

Acceptance criteria

  • Production demo links resolve directly to https://app.writehumanly.net/documents/new?demo=1.
  • Local development continues to use a relative product URL.
  • Frontend-user typecheck passes.

Out of scope

  • Changes to the demo workflow itself.
  • Changes to authenticated document navigation.

References

Found during deployed regression verification after #1011.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:frontend-user@humanly/frontend-user packagetype:old-gapExisting behavior that previous QA did not cover

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions