Next.js Discord

Discord Forum

metadata disallowed in client components - Root layout

Answered
Spinge Bib Sqorpnts posted this in #help-forum
Open in Discord
Avatar
Hello! My root layout does not have a "use client" directive at the top, yet after updating to 13.5.1, the compiler says that I'm trying to export "metadata" from a component marked with "use client", even though it isn't.
Reverting to 13.4 fixes the issue
Answered by Spinge Bib Sqorpnts
Figured out the answer.
Importing something in a client components that is exported from a server component causes the compiler to fail, but it won't give you the correct reason.
View full answer

3 Replies

Avatar
Tried to remove everything I've added in the layout file, to no avail
Also tried deleting the .next directory
Avatar
Figured out the answer.
Importing something in a client components that is exported from a server component causes the compiler to fail, but it won't give you the correct reason.
Answer