Next.js Discord

Discord Forum

How to make git versioning more robust? (Error persists even when I revert to earlier commits)

Unanswered
Alapaha Blue Blood Bulldog posted this in #help-forum
Open in Discord
Alapaha Blue Blood BulldogOP
I'm encountering a strange error in my Next.js project: Next.js error: Missing and tags in Root Layout

The thing I dont understand is: The error persists even when I revert to earlier commits in my git history when the App worked.

My question is also, how can I make my versioning "bulletproof" so that when I revert the commits or go to an earlier branch that I truely go back how the state of the nextjs project was?

The error is:
The following tags are missing in the Root Layout: , .Read more at https://nextjs.org/docs/messages/missing-root-layout-tags

The weird part is, my RootLayout component definitely includes these tags:

export default function RootLayout({
  children,
}: Readonly<{ children: React.ReactNode }>) {
  return (
    <html lang="en" className={`${GeistSans.variable}`}>
      <body>{children}</body>
    </html>
  );
}


I've tried:
- Reverting to different commits
- Clearing the .next folder
- Rebuilding the project
- Checking my next.config.js

Thanks in advance.

7 Replies

Komondor
are you sure that layout.tsx is your root layout?
do you mind sharing your directory structure
Alapaha Blue Blood BulldogOP
Here is my directory structure:
@Komondor do you mind sharing your directory structure
Alapaha Blue Blood BulldogOP
What is strange is that everything worked. I committed, even created a new branch. Started to experiment with a new feature which didnt work out. I wanted to reverse / go back to the old commit and now the App does not work anymore.
hey have you tried nuking node_modules and/or doing a npm i?
Alapaha Blue Blood BulldogOP
Yes. I have done that rm -rf .next node_modules and then pnpm install again.
Komondor
can you share a screenshot of the error