Error: Unsupported Server Component type: {...}
Answered
Havana posted this in #help-forum
HavanaOP
How do I fix this error? I am trying to use the new app router features and don't understand how to fix this.
31 Replies
Original message was deleted
HavanaOP
honestly i don't know what else I can add
can you help me
@Havana honestly i don't know what else I can add
Can you give me some reproduction code
A reproduction repository would be nice
Because, again, it’s impossible to know what’s wrong from just this. You have to give us more info else we can’t even make an educated guess
HavanaOP
git@github.com:nikoescobal/e-commerce-app.git --> here you go. Sorry i'm not explaining well enough
I made the mistake of pushing first before checking if it's still running properly
and then I was trying to configure things - deciding on whether I should go with pages or app router
somewhere along the way, I messed things up I believe
@Havana https://github.com/nikoescobal/e-commerce-app
Ok firstly, remove RootLayout from page.jsx
Answer
RootLayout is already handled by layout.jsx so if you use that you will have a root layout nested inside another root layout
And as you know, <html> cannot be nested inside <html>
HavanaOP
wow bro that was it
why is it i can't use rootlayout
isn't that a new feature
where you can use layout to render things like header, footer and things that will be prsent across pages
@joulev And as you know, <html> cannot be nested inside <html>
HavanaOP
if you're referring to the .html files i have randomly at the root, those are just for reference
@Havana if you're referring to the .html files i have randomly at the root, those are just for reference
No. Page files are already automatically wrapped inside layout files, so RootLayout in layout.js is already rendered
If you use it inside page.js as well, you get
<RootLayout>
<RootLayout>
…
</RootLayout>
</RootLayout>
<RootLayout>
<RootLayout>
…
</RootLayout>
</RootLayout>
Which is not allowed since RootLayout renders a <html> tag and <html> tags cannot be nested inside each other
HavanaOP
Dang. I see. Thank you for clarifying that! really appreciate it!
HavanaOP
can I ask another question
Please open another forum post if it’s different from this question
HavanaOP
it's not a bug per se
do I stil make it a question
or just post on general?
Depends. Specific to your code? #help-forum. Requires you to post your code? #help-forum. But can be talked in a theoretical way that doesn’t require long code? #discussions is fine
HavanaOP
not too long but I made a question 🙂
I'll also post if that is fine