Skip to content

Sidebar not rendering in Nextra v4 with Next.js 15.4.6 #4767

Description

@itsalimanuel

Versions

"next": "15.4.6",
"nextra": "^4.2.16",
"nextra-theme-docs": "^4.2.16",
"react": "19.1.0",
"react-dom": "19.1.0"

Reproduction steps

  1. Install Nextra 4 in a Next.js 15 app.

  2. Project structure:

    app/docs/
    ├── layout.tsx
    ├── _meta.json
    ├── page.mdx
    ├── about/page.mdx
    └── frameworks/page.mdx
    
  3. app/docs/layout.tsx:

    import { Layout } from "nextra-theme-docs";
    import { getPageMap } from "nextra/page-map";
    import "nextra-theme-docs/style.css";
    
    export default async function DocsLayout({ children }: { children: React.ReactNode }) {
      const pageMap = await getPageMap();
      console.log("PAGE MAP:", pageMap);
    
      return (
       <Layout
       navigation={true}
       navbar={navbar}
       search={search}
       sidebar={{ defaultOpen: true }}
       pageMap={await getPageMap()}
       docsRepositoryBase="https://github.com/shuding/nextra/tree/main/docs"
       footer={footer}
     >
       {children}
     </Layout>
      );
    }
  4. _meta.json:

    {
      "index": "Home",
      "about": "About",
      "frameworks": "Frameworks"
    }
  5. Run bun run dev → open /docs.

Expected behavior

  • A sidebar should appear on the left, listing Home, About, and Frameworks.

Actual behavior

  • No sidebar is shown.
  • Only the main content (page.mdx) renders.

Notes

  • Tried both _meta.json and _meta.js.
  • Cleared .next/ cache and restarted.
  • Behavior persists with a minimal layout.tsx and no custom overrides.
  • Possibly related to navigation / _meta.json not being picked up in App Router mode on Next.js 15.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions