Hi Folks,
I’m having the below error message.
I’ve tried resetting the cache and using the Fix with v0 function, but nothing seems to work.
The error you’re getting says this
Error: x You are attempting to export "metadata" from a component marked with "use client", which is disallowed. Either remove the export, or the "use client" directive. Read more: https://nextjs.org/
| docs/app/api-reference/directives/use-client
|
|
,-[/vercel/path1/app/practice-test/page.tsx:12:1]
10 | import type { Metadata } from "next"
11 |
12 | export const metadata: Metadata = {
: ^^^^^^^^
`----
It’s strange that the Fix with v0 button couldn’t sort this out automatically, but the key is to remove the metadata export from the page.tsx file. There are a few ways to keep the title/description intact, but I’d tell v0 to fix it for you like this
Move the metadata export from app/practice-test/page.tsx (client component) to app/practice-test/layout.tsx (server component)
Thanks, but that didn’t work either