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

[NEXT-1207] Default viewport tag not generated for not-found pages. #49979

Closed
1 task done
josias-r opened this issue May 18, 2023 · 1 comment · Fixed by #50044
Closed
1 task done

[NEXT-1207] Default viewport tag not generated for not-found pages. #49979

josias-r opened this issue May 18, 2023 · 1 comment · Fixed by #50044
Assignees
Labels
area: app App directory (appDir: true) linear: next Confirmed issue that is tracked by the Next.js team. Metadata Related to Next.js' Metadata API.

Comments

@josias-r
Copy link

josias-r commented May 18, 2023

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

Operating System:
      Platform: darwin
      Arch: arm64
      Version: Darwin Kernel Version 22.4.0: Mon Mar  6 20:59:58 PST 2023; root:xnu-8796.101.5~3/RELEASE_ARM64_T6020
    Binaries:
      Node: 18.15.0
      npm: 9.5.0
      Yarn: N/A
      pnpm: N/A
    Relevant packages:
      next: 13.4.2
      eslint-config-next: 13.4.2
      react: 18.2.0
      react-dom: 18.2.0
      typescript: 5.0.4

Which area(s) of Next.js are affected? (leave empty if unsure)

App directory (appDir: true), Routing (next/router, next/navigation, next/link)

Link to the code that reproduces this issue

to-reproduce is simple enough :) and codesandbox breaks when I create a not-found.tsx file :(

To Reproduce

  1. create-next-app
  2. Create a not-found.tsx page
  3. Add notFound() to the top of your root page
  4. Access / -> default viewport tag is there
  5. Access /does-not-exist default viewport tag is missing

Describe the Bug

So far accessing a page /does-not-exist and one triggered by notFound() behave a little differently even though they both render the not-found page.

It looks like a fix for broken Link is on its way. But there is also an issue with the default viewport meta tag that NextJS adds.

When accessing a /does-not-exist that viewport tag is missing, while for a notFound() page, it will be there.

Expected Behavior

The default viewport tag is always added to the page

Which browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

No response

NEXT-1207

@josias-r josias-r added the bug Issue was opened via the bug report template. label May 18, 2023
@github-actions github-actions bot added area: app App directory (appDir: true) Navigation Related to Next.js linking (e.g., <Link>) and navigation. labels May 18, 2023
@huozhi huozhi self-assigned this May 19, 2023
@huozhi huozhi added the linear: next Confirmed issue that is tracked by the Next.js team. label May 19, 2023
@huozhi huozhi changed the title Default viewport tag not generated for not-found pages. [NEXT-1207] Default viewport tag not generated for not-found pages. May 19, 2023
@huozhi huozhi added Metadata Related to Next.js' Metadata API. and removed bug Issue was opened via the bug report template. Navigation Related to Next.js linking (e.g., <Link>) and navigation. labels May 19, 2023
@kodiakhq kodiakhq bot closed this as completed in #50044 May 19, 2023
kodiakhq bot pushed a commit that referenced this issue May 19, 2023
* Adding default metadata to root not found under root layout
* Refactor the tests a bit, previously it only checks if the text existed in html, it actually exisits in flight response

Fixes #49979
Closes NEXT-1207
hydRAnger pushed a commit to hydRAnger/next.js that referenced this issue Jun 12, 2023
* Adding default metadata to root not found under root layout
* Refactor the tests a bit, previously it only checks if the text existed in html, it actually exisits in flight response

Fixes vercel#49979
Closes NEXT-1207
@github-actions
Copy link
Contributor

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: app App directory (appDir: true) linear: next Confirmed issue that is tracked by the Next.js team. Metadata Related to Next.js' Metadata API.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants