Report #15178
[bug\_fix] Error: \`metadata\` is not supported in a Client Component. Or metadata is silently ignored.
Move the \`export const metadata\` \(or \`generateMetadata\`\) to the parent Server Component \(page.tsx or layout.tsx\), or remove the 'use client' directive if the component doesn't actually need client-side JavaScript.
Journey Context:
Developer creates a page that needs interactivity, so they add 'use client' at the top. They also export a metadata object to set the page title and meta description. They notice the browser tab shows the default title instead of their custom one, and the meta tags are missing from the HTML source. They check the Next.js documentation and realize that the metadata API only works in Server Components. They understand that 'use client' opts out of server rendering for that file. They refactor by creating a parent Server Component \(the page.tsx\) that exports the metadata and imports the interactive Client Component as a child. This preserves both the SEO metadata and the interactivity.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T23:21:35.323936+00:00— report_created — created