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

notFound() does not replace robots tag #67907

Open
fmacherey opened this issue Jul 18, 2024 · 1 comment
Open

notFound() does not replace robots tag #67907

fmacherey opened this issue Jul 18, 2024 · 1 comment
Labels
bug Issue was opened via the bug report template. Metadata Related to Next.js' Metadata API. Navigation Related to Next.js linking (e.g., <Link>) and navigation.

Comments

@fmacherey
Copy link
Contributor

Link to the code that reproduces this issue

https://codesandbox.io/p/devbox/app-meta-robots-issue-66fwcs?layout=%257B%2522sidebarPanel%2522%253A%2522EXPLORER%2522%252C%2522rootPanelGroup%2522%253A%257B%2522direction%2522%253A%2522horizontal%2522%252C%2522contentType%2522%253A%2522UNKNOWN%2522%252C%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522id%2522%253A%2522ROOT_LAYOUT%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522UNKNOWN%2522%252C%2522direction%2522%253A%2522vertical%2522%252C%2522id%2522%253A%2522clyrb3nwj00073b6sqq6xm9do%2522%252C%2522sizes%2522%253A%255B70%252C30%255D%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522EDITOR%2522%252C%2522direction%2522%253A%2522horizontal%2522%252C%2522id%2522%253A%2522EDITOR%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL%2522%252C%2522contentType%2522%253A%2522EDITOR%2522%252C%2522id%2522%253A%2522clyrb3nwj00023b6sotsfakd2%2522%257D%255D%257D%252C%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522SHELLS%2522%252C%2522direction%2522%253A%2522horizontal%2522%252C%2522id%2522%253A%2522SHELLS%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL%2522%252C%2522contentType%2522%253A%2522SHELLS%2522%252C%2522id%2522%253A%2522clyrb3nwj00043b6sbe2sqt30%2522%257D%255D%252C%2522sizes%2522%253A%255B100%255D%257D%255D%257D%252C%257B%2522type%2522%253A%2522PANEL_GROUP%2522%252C%2522contentType%2522%253A%2522DEVTOOLS%2522%252C%2522direction%2522%253A%2522vertical%2522%252C%2522id%2522%253A%2522DEVTOOLS%2522%252C%2522panels%2522%253A%255B%257B%2522type%2522%253A%2522PANEL%2522%252C%2522contentType%2522%253A%2522DEVTOOLS%2522%252C%2522id%2522%253A%2522clyrb3nwj00063b6snoopsfrp%2522%257D%255D%252C%2522sizes%2522%253A%255B100%255D%257D%255D%252C%2522sizes%2522%253A%255B50%252C50%255D%257D%252C%2522tabbedPanels%2522%253A%257B%2522clyrb3nwj00023b6sotsfakd2%2522%253A%257B%2522tabs%2522%253A%255B%257B%2522id%2522%253A%2522clyrb3nwj00013b6slgz5aiu0%2522%252C%2522mode%2522%253A%2522permanent%2522%252C%2522type%2522%253A%2522FILE%2522%252C%2522filepath%2522%253A%2522%252FREADME.md%2522%257D%255D%252C%2522id%2522%253A%2522clyrb3nwj00023b6sotsfakd2%2522%252C%2522activeTabId%2522%253A%2522clyrb3nwj00013b6slgz5aiu0%2522%257D%252C%2522clyrb3nwj00063b6snoopsfrp%2522%253A%257B%2522tabs%2522%253A%255B%257B%2522id%2522%253A%2522clyrb3nwj00053b6sdvyjnp14%2522%252C%2522mode%2522%253A%2522permanent%2522%252C%2522type%2522%253A%2522TASK_PORT%2522%252C%2522taskId%2522%253A%2522dev%2522%252C%2522port%2522%253A3000%252C%2522path%2522%253A%2522%252F%2522%257D%255D%252C%2522id%2522%253A%2522clyrb3nwj00063b6snoopsfrp%2522%252C%2522activeTabId%2522%253A%2522clyrb3nwj00053b6sdvyjnp14%2522%257D%252C%2522clyrb3nwj00043b6sbe2sqt30%2522%253A%257B%2522tabs%2522%253A%255B%257B%2522id%2522%253A%2522clyrb3nwj00033b6sjdk6862c%2522%252C%2522mode%2522%253A%2522permanent%2522%252C%2522type%2522%253A%2522TASK_LOG%2522%252C%2522taskId%2522%253A%2522dev%2522%257D%255D%252C%2522id%2522%253A%2522clyrb3nwj00043b6sbe2sqt30%2522%252C%2522activeTabId%2522%253A%2522clyrb3nwj00033b6sjdk6862c%2522%257D%257D%252C%2522showDevtools%2522%253Atrue%252C%2522showShells%2522%253Atrue%252C%2522showSidebar%2522%253Atrue%252C%2522sidebarPanelSize%2522%253A15%257D

To Reproduce

  1. open Sandbox
  2. inspect page
  3. find two entries in the header

Current vs. Expected behavior

notFound is replacing the existing meta robots entry with noindex, so there is only one entry in the page

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 23.5.0: Wed May  1 20:14:38 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6020
  Available memory (MB): 32768
  Available CPU cores: 12
Binaries:
  Node: 20.9.0
  npm: 10.1.0
  Yarn: 1.22.19
  pnpm: 9.1.2
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.4.5
Next.js Config:
  output: N/A

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

Metadata, Navigation

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

next dev (local), next build (local), next start (local)

Additional context

No response

@fmacherey fmacherey added the bug Issue was opened via the bug report template. label Jul 18, 2024
@github-actions github-actions bot added Metadata Related to Next.js' Metadata API. Navigation Related to Next.js linking (e.g., <Link>) and navigation. labels Jul 18, 2024
@fmacherey
Copy link
Contributor Author

I just found out, when I call notFound() inside generateMetadata(), then the meta attributes don't get appended into the DOM. But not sure, if this is an feature?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue was opened via the bug report template. Metadata Related to Next.js' Metadata API. Navigation Related to Next.js linking (e.g., <Link>) and navigation.
Projects
None yet
Development

No branches or pull requests

1 participant