Skip to content

ClientRouter does not intercept link clicks in SSR mode while navigate() works #17307

Description

@dreyfus92

Astro Info

Astro                    v7.0.6
Node                     v24.1.0
System                   macOS (arm64)
Package Manager          pnpm
Output                   server
Adapter                  @astrojs/cloudflare
Integrations             none

If this issue only occurs in one browser, which browser is a problem?

chrome

Describe the Bug

with output: 'server' and <ClientRouter /> in the project, internal <a> clicks do a full page reload instead of client-side navigation. navigate() from astro:transitions/client still works and triggers the normal transition lifecycle (astro:before-preparation and then goes astro:after-swap).

so ClientRouter appears to be loaded, but its click interception does not run for link clicks.

What's the expected result?

i would expect what view transitions docs claim, clicking an internal link should be handled by <ClientRouter /> without a full document reload.

Link to Minimal Reproducible Example

https://stackblitz.com/edit/withastro-astro-bw6zwefq?file=src%2Fcomponents%2FDebugPanel.astro

Participation

  • I am willing to submit a pull request for this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    - P3: minor bugAn edge case that only affects very specific usage (priority)pkg: astroRelated to the core `astro` package (scope)triage: fix pendingReporter needs to verify the triage bot fix works

    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