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

Link header is not set in Next.js 15.1 #1609

Closed
3 tasks done
tobiashaefermann opened this issue Dec 13, 2024 · 2 comments
Closed
3 tasks done

Link header is not set in Next.js 15.1 #1609

tobiashaefermann opened this issue Dec 13, 2024 · 2 comments
Labels
bug Something isn't working unconfirmed Needs triage.

Comments

@tobiashaefermann
Copy link

Description

In Next.js 15.1 the Link header with hreflang links is not set, it seems to be removed or overridden.

I provided a minimum reproducible example which contains a freshly installed Next app (create-next-app) with the basic setup of next-intl (start dev server). Alternatively you can use the example-app-router and just bump the Next.js version to 15.1.

Link headers in dev server before:

link:
<http://localhost:3001/en>; rel="alternate"; hreflang="en"
<http://localhost:3001/de>; rel="alternate"; hreflang="de
<http://localhost:3001/>; rel="alternate"; hreflang="x-default"

link:
</_next/static/media/a34f9d1faa5f3315-s.p.woff2>; rel=preload; as="font"; crossorigin=""; type="font/woff2"

Link headers in Next.js 15.1:

link:
</_next/static/media/a34f9d1faa5f3315-s.p.woff2>; rel=preload; as="font"; crossorigin=""; type="font/woff2"
</_next/static/css/app/layout.css?v=1734104148288>; rel=preload; as="style"
</_next/static/css/app/%5Blocale%5D/layout.css?

Verifications

Mandatory reproduction URL

https://github.com/tobiashaefermann/next-intl-link-header-bug

Reproduction description

Steps to reproduce:

  1. Clone reproduction repo
  2. Install dependecies (pnpm install)
  3. Start dev server: pnpm dev
  4. Open home page and inspect document request headers

Expected behaviour

I expect the link header to be properly set in the default setup (as it is described in the docs and works for Next.js 14). As the peer dependencies include Next.js 15, I consider this as a bug.

@tobiashaefermann tobiashaefermann added bug Something isn't working unconfirmed Needs triage. labels Dec 13, 2024
@tobiashaefermann
Copy link
Author

I see this is already opened as an issue in the nextjs repo: vercel/next.js#69000 and there's already a PR provided, waiting to be merged: vercel/next.js#73431.

I leave this open for now for other people as reference :) thanks!

@amannn
Copy link
Owner

amannn commented Dec 16, 2024

Yep, an issue is also already open in this repo: #1442. I'll close in favor of the existing one.

@amannn amannn closed this as completed Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working unconfirmed Needs triage.
Projects
None yet
Development

No branches or pull requests

2 participants