Uncaught Error: invariant expected app router to be mounted

Happened to me when layout.tsx didn’t have <body> and <html> tag.

Edit:

Here is the exact section from documentation

The root layout must define <html> and <body> tags since Next.js does not automatically create them.

Leave a Comment