Closed joelrb closed 6 months ago
Can confirm, fresh setup & happening for me as well.
I'm sure it's beeen resolved, but you have to move it from metadata to viewport like so
export const viewport = { themeColor: [ { media: '(prefers-color-scheme: dark)', color: 'black' }, { media: '(prefers-color-scheme: light)', color: 'white' } ] }
I just tried to create next app from template to see if it's been resolved. It's not yet resolved.
The issue is caused by calling Metadata interface in the layout.tsx.
This can be fixed by following.
export const viewport: Viewport = {
themeColor: [
{ media: "(prefers-color-scheme: light)", color: "white" },
{ media: "(prefers-color-scheme: dark)", color: "black" },
],
}
~There is a PR already raised https://github.com/nextui-org/next-app-template/pull/18 which will fix this.~
This is already fixed by this commit on main https://github.com/nextui-org/next-app-template/commit/44b9a9320938d8955ec84e849a7c27404c489e0b
The issue can be closed now. :)
Just created app using the template. npx create-next-app@latest myapp -e https://github.com/nextui-org/next-app-template
After setup, I immediately ran it. Warning in terminal: ⚠ Unsupported metadata themeColor is configured in metadata export. Please move it to viewport export instead.
Thanks for fixing. Great work!