nextjs - 💡(How to fix) Fix Bug: Runtime 500 - clientReferenceManifest undefined for server-only pages in Next.js 15.5.18

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

  1. Navigate to http://localhost:3000500 Internal Server Error Error [InvariantError]: Invariant: Expected clientReferenceManifest to be defined.
  • Error: "Expected clientReferenceManifest to be defined. This is a bug in Next.js."
  • #82229 (mixed routers, similar error)
  • nextjs/saas-starter#174 (build-time, similar error) The error message itself acknowledges this: "This is a bug in Next.js."

Fix Action

Fix / Workaround

Attempted workarounds:

Successful workaround:

  • Downgrade to Next.js 15.4.x or 14.2.x (not tested yet due to React 19 peer dependency conflicts)

Code Example

npx create-next-app@15.5.18 --typescript --app --no-src-dir my-app
cd my-app

---

// app/(marketing)/page.tsx
import type { Metadata } from "next";

export const metadata: Metadata = {
  title: "Home Page",
};

export default function HomePage() {
  return (
    <div>
      <h1>Hello World</h1>
      <p>This is a server-only page with no client components.</p>
    </div>
  );
}

---

npm run build
npm start

---

Error [InvariantError]: Invariant: Expected clientReferenceManifest to be defined. 
This is a bug in Next.js.
    at k (.next/server/app/(marketing)/page.js:1:4757)
    at m (.next/server/app/(marketing)/page.js:1:7389)
    at n (.next/server/app/(marketing)/page.js:2:1780)
    at responseGenerator (.next/server/app/(marketing)/page.js:2:1918)

---

Operating System:
  Platform: darwin (macOS)
  Arch: arm64
  Version: Darwin 24.5.0
Binaries:
  Node: 25.9.0
  npm: 10.9.2
Relevant Packages:
  next: 15.5.18
  react: 19.2.3
  react-dom: 19.2.3
  @sentry/nextjs: 10.53.1 (optional, but may trigger the issue)
  typescript: 5.8.3
Next.js Config:
  output: N/A

---

const { withSentryConfig } = require("@sentry/nextjs");

const nextConfig = {
  // Standard config
};

module.exports = withSentryConfig(nextConfig, {
  org: "quote-anvil",
  project: "javascript-nextjs",
  silent: !process.env.CI,
  widenClientFileUpload: false, // Disabled due to ENOENT
  tunnelRoute: "/monitoring",
  webpack: {
    automaticVercelMonitors: true,
    treeshake: {
      removeDebugLogging: true,
    },
  },
});
RAW_BUFFERClick to expand / collapse

Bug: Runtime 500 - clientReferenceManifest undefined for server-only pages in Next.js 15.5.18

Link to the code that reproduces this issue

See reproduction steps below (minimal example included)

To Reproduce

Minimal reproduction:

  1. Create Next.js 15.5.18 app with App Router:
npx [email protected] --typescript --app --no-src-dir my-app
cd my-app
  1. Create a server-only page without client components:
// app/(marketing)/page.tsx
import type { Metadata } from "next";

export const metadata: Metadata = {
  title: "Home Page",
};

export default function HomePage() {
  return (
    <div>
      <h1>Hello World</h1>
      <p>This is a server-only page with no client components.</p>
    </div>
  );
}
  1. Build and start production server:
npm run build
npm start
  1. Navigate to http://localhost:3000500 Internal Server Error

  2. Check server logs:

Error [InvariantError]: Invariant: Expected clientReferenceManifest to be defined. 
This is a bug in Next.js.
    at k (.next/server/app/(marketing)/page.js:1:4757)
    at m (.next/server/app/(marketing)/page.js:1:7389)
    at n (.next/server/app/(marketing)/page.js:2:1780)
    at responseGenerator (.next/server/app/(marketing)/page.js:2:1918)

Current vs. Expected behavior

Current:

  • Build succeeds ✅
  • Production runtime crashes with 500 ❌
  • Error: "Expected clientReferenceManifest to be defined. This is a bug in Next.js."
  • Affects server-only pages without client components

Expected:

  • Server-only pages should work at runtime
  • clientReferenceManifest should not be required for pages without client components

Provide environment information

Operating System:
  Platform: darwin (macOS)
  Arch: arm64
  Version: Darwin 24.5.0
Binaries:
  Node: 25.9.0
  npm: 10.9.2
Relevant Packages:
  next: 15.5.18
  react: 19.2.3
  react-dom: 19.2.3
  @sentry/nextjs: 10.53.1 (optional, but may trigger the issue)
  typescript: 5.8.3
Next.js Config:
  output: N/A

next.config.js:

const { withSentryConfig } = require("@sentry/nextjs");

const nextConfig = {
  // Standard config
};

module.exports = withSentryConfig(nextConfig, {
  org: "quote-anvil",
  project: "javascript-nextjs",
  silent: !process.env.CI,
  widenClientFileUpload: false, // Disabled due to ENOENT
  tunnelRoute: "/monitoring",
  webpack: {
    automaticVercelMonitors: true,
    treeshake: {
      removeDebugLogging: true,
    },
  },
});

Which area(s) are affected? (Select all that apply)

  • App Router
  • Runtime (production)
  • Build output

Which stage(s) are affected? (Select all that apply)

  • next start (local)
  • Vercel (Deployed)

Additional context

Deep dive:

  1. Build artifacts:

    • .next/server/app/(marketing)/page.js exists
    • .next/server/app/(marketing)/page.js.nft.json references page_client-reference-manifest.js
    • .next/server/app/(marketing)/page_client-reference-manifest.js does NOT exist
  2. Pattern:

    • Pages with client components generate proper manifests and work fine
    • Pages without client components don't generate manifests and crash at runtime
    • Examples working: /pricing, /features (have client components)
    • Examples broken: / (root), /dashboard (server-only until auth check)
  3. Build vs Runtime:

    • Build succeeds (no errors)
    • Runtime crashes when accessing affected pages
    • This is a production-only issue (or appears in next start but not next dev)

Attempted workarounds:

  1. ❌ Create empty manifest placeholders → Build succeeds, runtime still crashes
  2. ❌ Remove export const dynamic = 'force-dynamic' → No effect
  3. ❌ Wrap page in 'use client' boundary → Manifest still empty, runtime crashes

Successful workaround:

  • Downgrade to Next.js 15.4.x or 14.2.x (not tested yet due to React 19 peer dependency conflicts)

Related issues:

  • #82229 (mixed routers, similar error)
  • nextjs/saas-starter#174 (build-time, similar error)

Impact:

  • Production sites return 500 on affected pages
  • Critical severity for landing pages
  • No data loss or security impact

Deployment context:

  • Vercel production deployments
  • Build succeeds, runtime fails
  • Multiple consecutive deploys affected (9 in our case)

This appears to be a regression in Next.js 15.5.x where the build process incorrectly assumes all pages need clientReferenceManifest files, even server-only pages. The .nft.json file references these manifests, but they're not generated, causing runtime crashes when Next.js tries to load them.

The error message itself acknowledges this: "This is a bug in Next.js."

Would appreciate guidance on:

  1. Is this a known issue with a fix in progress?
  2. Should server-only pages require manifests in Next.js 15.5?
  3. Is there a configuration to disable manifest generation for specific pages?

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

nextjs - 💡(How to fix) Fix Bug: Runtime 500 - clientReferenceManifest undefined for server-only pages in Next.js 15.5.18