amannn / next-intl

🌐 Internationalization (i18n) for Next.js
https://next-intl-docs.vercel.app
MIT License
2.3k stars 210 forks source link

NextJS 15's `next/font` breaks alternate header injection. #1261

Open zenzen-sol opened 3 weeks ago

zenzen-sol commented 3 weeks ago

Description

I notice that in the NextJS 15 release candidate, the "alternate" links that should appear in the response header are missing if next/font is used to optimize fonts. I'm not sure whether this issue belongs to NextJS or next-intl.

Verifications

Mandatory reproduction URL

https://github.com/zenzen-sol/next-reproduction-template/tree/sol/repro-001-next-15-broken

Reproduction description

Steps to reproduce:

  1. Open reproduction
  2. Run pnpm run dev
  3. Reload http://localhost:3000 in a browser.
  4. Check the response header links in dev tools.

✅ OK(Next 14): https://github.com/zenzen-sol/next-reproduction-template/tree/sol/repro-001-Next-14-working

CleanShot 2024-08-16 at 16 44 36@2x


🙅🏻Broken (Next 15rc + next/font): https://github.com/zenzen-sol/next-reproduction-template/tree/sol/repro-001-next-15-broken

CleanShot 2024-08-16 at 16 45 25@2x


✅ OK (Next 15rc without next/font): https://github.com/zenzen-sol/next-reproduction-template/tree/sol/repro-001-next-15-working

CleanShot 2024-08-16 at 16 46 20@2x

Expected behaviour

Both the next-intl and next/font links should be present in the response header.

amannn commented 3 weeks ago

Many thanks for the thoughtful bug report and reproduction! Do you think you could report this upstream in the Next.js repo? Seems like this is something to be addressed there. If you do, can you leave a link here so we can track the upstream issue?

zenzen-sol commented 3 weeks ago

@amannn Thanks. The upstream issue is here.

amannn commented 3 weeks ago

Thanks a lot, I'll keep an eye on the issue!