Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Last version broke canonical URLs #63422

Open
philipheinser opened this issue Mar 18, 2024 · 3 comments
Open

Last version broke canonical URLs #63422

philipheinser opened this issue Mar 18, 2024 · 3 comments
Labels
bug Issue was opened via the bug report template.

Comments

@philipheinser
Copy link

Link to the code that reproduces this issue

https://codesandbox.io/p/devbox/pensive-star-go8s7s?file=%2Fapp%2Fpage.tsx%3A1%2C62

To Reproduce

set a canonical url look what happens

Current vs. Expected behavior

Screenshot 2024-03-18 at 17 44 30 Screenshot 2024-03-18 at 17 44 38

Provide environment information

every system

Which area(s) are affected? (Select all that apply)

App Router

Which stage(s) are affected? (Select all that apply)

next dev (local), next build (local), next start (local), Other (Deployed)

Additional context

why does with almost every minor release break something in the router :(

@philipheinser philipheinser added the bug Issue was opened via the bug report template. label Mar 18, 2024
@devjiwonchoi
Copy link
Member

Hi, could you please specify more about the issue? I'll be happy to take a look at it.

@philipheinser
Copy link
Author

@devjiwonchoi if you have a canonical url in the meta object it comes out different in the actual html rendered. We put in with no / and in the html there is / added.

@devjiwonchoi
Copy link
Member

I cannot reproduce your case; it'd be great if you updated the code sandbox to a valid reproduction.

export default async function Page() {
  return null;
}

export const metadata = {
  alternates: {
    canonical: 'https://acme.com',
  },
};
Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 23.1.0: Mon Oct  9 21:32:11 PDT 2023; root:xnu-10002.41.9~7/RELEASE_ARM64_T6030
  Available memory (MB): 18432
  Available CPU cores: 11
Binaries:
  Node: 18.17.0
  npm: 9.6.7
  Yarn: 1.22.19
  pnpm: 8.15.4
Relevant Packages:
  next: 14.2.0-canary.38 // Latest available version is detected (14.2.0-canary.38).
  eslint-config-next: 14.1.4
  react: 18.2.0
  react-dom: 18.2.0
  typescript: 5.4.3
Next.js Config:
  output: N/A

Screenshot 2024-03-23 at 3 51 54 AM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue was opened via the bug report template.
Projects
None yet
Development

No branches or pull requests

2 participants