Skip to content

Bug: GitHub storage admin UI renders blank on Next.js 16 (local mode works) #1549

Description

@benjibug

Summary

With storage.kind: 'github', the Keystatic admin UI at /keystatic renders completely blank on Next.js 16 — no admin DOM, no console error, no pageerror, no Next error overlay. The same app with storage.kind: 'local' renders the full admin UI correctly. The GitHub OAuth endpoints themselves work; it's specifically the client UI that never mounts in the GitHub code path — including the /keystatic/setup wizard, so the app can't even be bootstrapped.

Environment

  • @keystatic/core: 0.5.50
  • @keystatic/next: 5.0.4
  • @keystar/ui: 0.7.21 (latest)
  • next: 16.2.9 (App Router)
  • react / react-dom: 19.2.7
  • Node: 22.17.1 · pnpm: 10.27 · macOS

Reproduction

  1. Next 16 App Router app with the standard Keystatic Next wiring:
    • keystatic.config.ts with storage: { kind: 'github', repo: { owner, name } }
    • app/keystatic/keystatic.tsxmakePage(config)
    • app/keystatic/[[...params]]/page.tsx
    • app/api/keystatic/[...params]/route.tsmakeRouteHandler({ config })
  2. pnpm dev, open /keystatic.

Expected

The admin UI loads — either the GitHub sign-in/setup screen (when unconfigured) or the authenticated collections view.

Actual

/keystatic returns 200 but the <body> contains only the framework/theme scripts — no Keystatic DOM at all. /keystatic/setup (the KeystaticSetup wizard) is likewise blank. No error is logged anywhere (console, pageerror, server, or Next overlay).

What I verified / ruled out

  • Local mode works: switching only storage.kind to 'local' renders the full admin UI (Dashboard/Collections/editor) in the exact same app — so it's specific to the GitHub path, not a general @keystar/ui/Spectrum mount failure.
  • Bundler: blank on both next dev (Turbopack) and next dev --webpack.
  • OAuth endpoints work: GET /api/keystatic/github/login 307-redirects correctly to https://github.com/login/oauth/authorize?client_id=…&redirect_uri=…, and following it reaches GitHub's auth page. So env vars (KEYSTATIC_GITHUB_CLIENT_ID/_SECRET, KEYSTATIC_SECRET, NEXT_PUBLIC_KEYSTATIC_GITHUB_APP_SLUG) are loaded and valid.
  • Auth completed: after creating a real GitHub App and completing the OAuth sign-in, /keystatic is still blank — so it's not gated on missing auth.
  • Not stale .next, not a routing/basePath issue (/keystatic/setup is reached but KeystaticSetup mounts nothing), and no middleware touching /keystatic.

Notes / hypothesis

Because local mode renders and only the GitHub path is blank — with no thrown error — it looks like a component in the GitHub auth/AppShell path (e.g. a urql/Suspense boundary or a silent null return) that doesn't mount under Next 16 + React 19.2. Possibly related to the Next 16 work in #1501, but the symptom here is a silent blank rather than a thrown error, and it reproduces on webpack too.

Happy to provide a minimal repro repo or test any patch.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions