Skip to content

Canonical links not respecting trailingSlash behaviour #6603

@marcellegane

Description

@marcellegane

Describe the bug

When trailingSlash: 'always' is set in createRouter, the canonical link href returned by a route's head() function and read through useRouterState via match.links does not have a trailing slash enforced.

The trailingSlash option correctly enforces trailing slashes on navigation URLs, but the href values in the links array on route matches are returned as-is without the trailing slash transformation applied.

Expected behavior

When trailingSlash: 'always' is configured, the router should ensure that href values in match.links also have a trailing slash appended.

How often does this bug happen?

Every time

Platform

  • @tanstack/react-router version 1.157.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions