Skip to content

fix: move themeColor and viewport to viewport export (Next.js 13.4+)#313

Open
Alishasaroha wants to merge 1 commit intoAOSSIE-Org:devfrom
Alishasaroha:fix/next-viewport-clean
Open

fix: move themeColor and viewport to viewport export (Next.js 13.4+)#313
Alishasaroha wants to merge 1 commit intoAOSSIE-Org:devfrom
Alishasaroha:fix/next-viewport-clean

Conversation

@Alishasaroha
Copy link

##Description

🐛 Fix: Move themeColor and viewport to Next.js viewport export

Background

Since Next.js 13.4+, viewport-related fields such as themeColor and viewport were moved from the metadata object into a dedicated viewport export. Keeping them inside metadata triggers a Next.js warning and may prevent the browser from correctly applying these values.

Changes

  • Removed themeColor and viewport from the metadata export
  • Added a proper export const viewport in app/layout.js with:
    • themeColor
    • width
    • initialScale

Result

  • Eliminates Next.js metadata warning
  • Ensures correct generation of:
    • <meta name="theme-color">
    • <meta name="viewport">
  • Aligns the project with the Next.js 13.4+ metadata API

Reference

Next.js docs:
https://nextjs.org/docs/app/api-reference/functions/generate-viewport

@Alishasaroha Alishasaroha requested a review from a team as a code owner February 22, 2026 17:00
@coderabbitai
Copy link

coderabbitai bot commented Feb 22, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@reach2saksham
Copy link

reach2saksham commented Mar 15, 2026

Hi @Alishasaroha, which issue is this PR resolving? I think this PR is for #310?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants