I'm using const canonicalURL = Astro.props.canonicalURL || new URL(Astro.url.pathname, Astro.site); in my baseHead.astro to generate canonical urls. This works fine apart from inserting a trailing slash at the end of the href. For example, https://sitename.com/pagename/ I do not want the end trailing slash to be there. My astro config has trailingSlash: 'never' but I'm not sure this have any influence on the aforementioned
I also just noticed, the trailing slash only appears once I run the build command