gatsby-plugin-canonical-urls: root page canonical url contains trailing slash when trailingSlash === never
#38377
Closed
2 tasks done
Labels
status: triage needed
Issue or pull request that need to be triaged and assigned to a reviewer
type: bug
An issue or pull request relating to a bug in Gatsby
Preliminary Checks
Description
When
trailingSlash
is set tonever
,gatsby-plugin-canonical-urls
generates a canonical url for the default page that ends in a trailling slash (all other pages are correct).The issue seems to stem from https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby-plugin-canonical-urls/src/gatsby-ssr.js#L10 where it always adds pathname to the parsed url.
Reproduction Link
https://codesandbox.io/p/sandbox/canonical-urls-contains-trailingslash-l7f9sf
Steps to Reproduce
trailingSlash
tonever
in gatsby-config.jsgatsby develop
)Note
If using Codesandbox repro, you may need to open the sandbox URL in a separate tab to open dev tools
Expected Result
The default page canonical url should not contain a trailing slash
Actual Result
The default page canonical url does contain a trailing slash
Environment
Config Flags
N/A
The text was updated successfully, but these errors were encountered: