vercel / vercel/next.js

Metadata not showing up in dev mode for not-found.tsx page

Open
#76,923 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dynamic Routes Metadata Not Found
Dominant language
JavaScript
Stars
142k
Forks
32.4k
Avg merge
2d 14h
Merged PRs (30d)
351

Description

Link to the code that reproduces this issue

https://github.com/dmorda/not-found-example

To Reproduce
  1. git clone https://github.com/dmorda/not-found-example
  2. cd not-found-example
  3. npm install
  4. npm run dev
  5. Visit http://localhost:3000/abc123
Current vs. Expected behavior

I expect the the title and meta description to be:

title: Page Not Found
meta-description: The page you are looking for does not exist.

The actual title and meta description are:

title: Create Next App
meta-description: Generated by create next app

If you remove the catch all route (i.e., [...slug]) folder and visit the same page, it will display:

title: Page Not Found
meta-description: The page you are looking for does not exist.

Provide environment information
Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.3.0: Thu Jan  2 20:24:22 PST 2025; root:xnu-11215.81.4~3/RELEASE_ARM64_T6041
  Available memory (MB): 49152
  Available CPU cores: 14
Binaries:
  Node: 22.14.0
  npm: 11.1.0
  Yarn: 1.22.22
  pnpm: N/A
Relevant Packages:
  next: 15.2.1 // Latest available version is detected (15.2.1).
  eslint-config-next: 15.2.1
  react: 19.0.0
  react-dom: 19.0.0
  typescript: 5.8.2
Next.js Config:
  output: N/A
Which area(s) are affected? (Select all that apply)

Metadata, Dynamic Routes

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

next dev (local)

Additional context

The behavior seemed to change between 15.1.7 (was working as expected) to 15.2.1 (stopped working as expected). It also only seems to happen in local development mode. If I build and deploy to Vercel, the same path produces the expected result containing the correct title and meta-description.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked reproduction and inspect the not-found.tsx page alongside the [...slug] catch-all route. Run npm run dev, visit /abc123, and compare the metadata with a build/deploy and with Next.js 15.1.7. Done means local development shows “Page Not Found” and the expected description for this route.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, next.js, react
Domain
frontend, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.