vercel / next.js

The React Framework
https://nextjs.org
MIT License
127.02k stars 26.99k forks source link

Metadata in root url Internationalization nextjs #55856

Open Minhnhat0408 opened 1 year ago

Minhnhat0408 commented 1 year ago

Verify canary release

Provide environment information

Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 10 Home Single Language
Binaries:
  Node: 18.12.1
  npm: N/A
  Yarn: N/A
  pnpm: N/A
Relevant Packages:
  next: 13.5.3-canary.3
  eslint-config-next: 13.4.19
  react: 18.2.0
  react-dom: 18.2.0
  typescript: 5.2.2
Next.js Config:
  output: N/A

Which example does this report relate to?

https://github.com/vercel/next.js/tree/canary/examples/app-dir-i18n-routing

What browser are you using? (if relevant)

Chrome

How are you deploying your application? (if relevant)

Vercel

Describe the Bug

Expected Behavior

It should also have the metadata in the root url.

To Reproduce

Clone the app-dir-i18n-routing repo, add a simple layout.tsx file with and (i think that next would not recognize a root layout without tag under app repository, or clone my repo Hub Media: Then to see opengraph you can dowload extension or deploy it then sent the root url in messenger app or twitter. also you can have my deploy link in the github repo.

DennieMello commented 1 year ago

Alternatively, you can configure redirection via nginx. For example, you can remove the default locale and stop only additional ones in the url.

server {
  listen 80;
  server_name test.com;

  location / {
    rewrite ^/(.*)$ /en/$1 break;
    proxy_pass http://your_app_server;
  }
}
Minhnhat0408 commented 1 year ago

I don't really get what you mean, I don't use nginx. Can you be more precise.

Malinicz commented 9 months ago

hey @Minhnhat0408, have you solved this issue somehow? I have similar problem now, open graph image is not displaying for my root url.