Skip to content

[strictSeo] canonicals do not respect trailingSlash config #3892

@francislg2

Description

@francislg2

Environment


  • Operating System: Darwin
  • Node Version: v22.14.0
  • Nuxt Version: 3.19.3
  • CLI Version: 3.29.3
  • Nitro Version: 2.12.8
  • Package Manager: [email protected]
  • Builder: -
  • User Config: -
  • Runtime Modules: -
  • Build Modules: -

@nuxtjs/i18n": "^10.2.1"

Reproduction

There seems to be an issue with Stackblitz. I was not able to create a reproduction.

But it should be pretty easy to replicate:

  1. in nuxt.config, set the configs
{
  i18n: {
    experimental: {
      strictSeo: true
    },
    trailingSlash: true,
  }
}
  1. run the dev server
  2. go on any route other than the home page
  3. look for the canonical link in the head of the DOM
  4. you should see urls without trailing slashes

Describe the bug

When using the strictSeo mode, it seems like the i18n.trailingSlash config is not respected.

For example, if I have trailingSlash: true, the canonicals will still output "/products" instead of "/products/"

Additional context

No response

Logs

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions