-
Notifications
You must be signed in to change notification settings - Fork 26.3k
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
viewport setting in metadata is not working correctly #63592
Comments
I recently upgraded vercel version and didn't realize that the viewport for metadata was deprecated. Thanks for letting me know🙏 @ttaerrim When I applied it as you suggested, it looks like |
Sorry, I deleted my comment by mistake.
But I don't know how to initialize viewport tag to none. |
Hi, next.js/packages/next/src/lib/metadata/default-metadata.tsx Lines 6 to 15 in 65d699e
Also, it is recommended to follow the Codemods so that you don't need to explicitly export ref: https://nextjs.org/docs/app/building-your-application/upgrading/codemods#use-viewport-export |
Actually, what I'm working on now is to show the desktop in 1920 width on the mobile screen. Before upgrading nextjs, it was The default value of initial-scale is 1, but I figured that its presence had an impact, so I set initial-scale to -1 and it worked fine. Thank you for your kind explanation and help in resolving the issue. |
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://codesandbox.io/p/devbox/priceless-rgb-2hcyms?file=%2Fapp%2Flayout.tsx&workspaceId=12540e31-6959-44ce-a050-2ec2eabe3bda
To Reproduce
Add code to root layout.tsx
Current vs. Expected behavior
current:
<meta name="viewport" content="width=device-width, initial-scale=1" />
expected:
<meta name="viewport" content="width=1920" />
Provide environment information
Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 23.2.0: Wed Nov 15 21:53:18 PST 2023; root:xnu-10002.61.3~2/RELEASE_ARM64_T6000 Binaries: Node: 20.11.0 npm: 10.2.4 Yarn: 1.22.19 pnpm: 8.14.1 Relevant Packages: next: 13.5.6 eslint-config-next: 13.5.6 react: 18.2.0 react-dom: 18.2.0 typescript: 4.9.5 Next.js Config: output: N/A
Which area(s) are affected? (Select all that apply)
App Router, Metadata (metadata, generateMetadata, next/head)
Which stage(s) are affected? (Select all that apply)
next dev (local), next build (local), next start (local), Vercel (Deployed), Other (Deployed)
Additional context
No response
The text was updated successfully, but these errors were encountered: