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
# Clone the repo to reproduce
gh repo clone ReoHakase/next13-app-head-is-not-working-in-not-found
# Install dependencies
pnpm i
# Run the dev server
pnpm dev
Visit /
You can see metadata from layout.tsx is loaded and working as intended.
Visit /404 or /not-found or /whatever-you-can-type
No metadata is loaded unlike /.
Since no viewport settings is given, the content gets displayed very tiny in mobile environment.
Describe the Bug
Metadata is not loaded and working in /not-found.tsx
metadata configuration
// layout.tsxexportconstmetadata: Metadata={title: {default: "Acme Inc.",template: "%s | Acme Inc.",},description: "Lorem Ipsum",viewport: {width: "device-width",initialScale: 1.0,},openGraph: {// Open graph image will be provided via file-based configuration.// Refer: https://beta.nextjs.org/docs/api-reference/metadata#static-imagestype: "website",},twitter: {card: "summary_large_image",site: "@acme",},themeColor: [{media: "(prefers-color-scheme: light)",color: "#f8f9fa"},{media: "(prefers-color-scheme: dark)",color: "#1a1d1e"},],};
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.
Verify canary release
Provide environment information
Operating System: Platform: darwin Arch: x64 Version: Darwin Kernel Version 22.1.0: Sun Oct 9 20:14:54 PDT 2022; root:xnu-8792.41.9~2/RELEASE_X86_64 Binaries: Node: 18.14.1 npm: 9.3.1 Yarn: 3.3.0 pnpm: 7.29.3 Relevant packages: next: 13.3.3-canary.1 eslint-config-next: N/A react: 18.2.0 react-dom: 18.2.0
Which area(s) of Next.js are affected? (leave empty if unsure)
App directory (appDir: true), Metadata (metadata, generateMetadata, next/head, head.js)
Link to the code that reproduces this issue
https://github.com/ReoHakase/next13-app-head-is-not-working-in-not-found
To Reproduce
Visit
/
You can see
metadata
fromlayout.tsx
is loaded and working as intended.Visit
/404
or/not-found
or/whatever-you-can-type
No
metadata
is loaded unlike/
.Since no viewport settings is given, the content gets displayed very tiny in mobile environment.
Describe the Bug
Metadata is not loaded and working in
/not-found.tsx
metadata
configurationRendered
<head>
in routes that/not-found.tsx
is usedNo corresponding tags is rendered, even
title
.Rendered
<head>
in the other normal routes such as/
.Working as expected
Expected Behavior
<head>
should be rendered with the following content in/not-found.tsx
, as it is working in the other routes.Which browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
The text was updated successfully, but these errors were encountered: