You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
P.S. The metadata does not exist at all in not-found.tsx. If there is some metadata in layout.tsx, it will apply, but not the metadata from not-found.tsx. Although the server-rendered HTML returned from the server contains the title, after hydration it seems like something overrides it, because I can see a brief flash of the 404 | Not found title, and then it disappears.
Current vs. Expected behavior
Current:
Metadata from not-found.tsx isn't applied when notFound() function is invoked manually.
Expected:
Metadata is applied from not-found.tsx when notFound() function is invoked manually.
Provide environment information
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 23.5.0: Wed May 1 20:12:58 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6000
Available memory (MB): 16384
Available CPU cores: 10
Binaries:
Node: 20.12.0
npm: 10.5.0
Yarn: 1.22.22
pnpm: N/A
Relevant Packages:
next: 14.2.5 // Latest available version is detected (14.2.5).
eslint-config-next: 14.2.5
react: 18.3.1
react-dom: 18.3.1
typescript: 5.5.4
Next.js Config:
output: N/A
Which area(s) are affected? (Select all that apply)
Metadata
Which stage(s) are affected? (Select all that apply)
next dev (local), next build (local), next start (local), Vercel (Deployed), Other (Deployed)
Additional context
The result is the same whether I use local dev server, built version, deployed on Vercel or custom build on k8s cluster in docker container.
The text was updated successfully, but these errors were encountered:
@jrjake It looks like invoking notFound() fn in my dynamic page in generateMetadata gives no positive effect and even worse, I received nothing even from parent generateMetadata.
This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.
Link to the code that reproduces this issue
https://github.com/valeryq/nextjs-not-found-metadata-bug-debug
To Reproduce
There are 2 behaviors:
URL: https://nextjs-not-found-metadata-bug-debug.vercel.app/
/test
withnotFound()
in Server Component render function (doesn't work as expected, wrong metadata).URL: https://nextjs-not-found-metadata-bug-debug-p93w1k52u.vercel.app/test
P.S. The metadata does not exist at all in not-found.tsx. If there is some metadata in layout.tsx, it will apply, but not the metadata from not-found.tsx. Although the server-rendered HTML returned from the server contains the title, after hydration it seems like something overrides it, because I can see a brief flash of the 404 | Not found title, and then it disappears.
Current vs. Expected behavior
Current:
Metadata from
not-found.tsx
isn't applied whennotFound()
function is invoked manually.Expected:
Metadata is applied from
not-found.tsx
whennotFound()
function is invoked manually.Provide environment information
Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 23.5.0: Wed May 1 20:12:58 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6000 Available memory (MB): 16384 Available CPU cores: 10 Binaries: Node: 20.12.0 npm: 10.5.0 Yarn: 1.22.22 pnpm: N/A Relevant Packages: next: 14.2.5 // Latest available version is detected (14.2.5). eslint-config-next: 14.2.5 react: 18.3.1 react-dom: 18.3.1 typescript: 5.5.4 Next.js Config: output: N/A
Which area(s) are affected? (Select all that apply)
Metadata
Which stage(s) are affected? (Select all that apply)
next dev (local), next build (local), next start (local), Vercel (Deployed), Other (Deployed)
Additional context
The result is the same whether I use local dev server, built version, deployed on Vercel or custom build on k8s cluster in docker container.
The text was updated successfully, but these errors were encountered: