Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
blader avatar

Nextjs Server Side Error Debugging

  • 2.4k repo stars
  • Updated February 21, 2026
  • blader/claudeception

nextjs-server-side-error-debugging is a Claude Code skill for debugging Next.js server-side errors that do not appear in the browser console.

About

This skill helps debug server-side errors in Next.js that do not surface in the browser console. A developer uses it when a page shows a generic 500 or Internal Server Error with an empty browser console, especially with getServerSideProps, getStaticProps, or API routes. It directs the developer to the dev-server terminal and hosting-provider logs for the real stack trace and lists common root causes.

  • Points debugging at the terminal, not the browser, for server-side Next.js errors
  • Covers getServerSideProps, getStaticProps, and API route 500s
  • Lists common causes: env vars, DB connections, client/server import leaks

Nextjs Server Side Error Debugging by the numbers

  • Data as of Aug 5, 2026 (Skillselion catalog sync)
At a glance

nextjs-server-side-error-debugging capabilities & compatibility

Capabilities
debugging · error handling · log analysis
Works with
vercel
Use cases
debugging
From the docs

What nextjs-server-side-error-debugging says it does

Server-side errors in Next.js don't appear in the browser console, making debugging frustrating when you're looking in the wrong place.
SKILL.md
The actual error with full stack trace appears in the terminal where `npm run dev` or `next dev` is running.
SKILL.md
Client-side errors (in useEffect, event handlers) DO appear in browser console— this skill only applies to server-side code
SKILL.md
npx skills add https://github.com/blader/claudeception --skill nextjs-server-side-error-debugging

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
repo stars2.4k
Last updatedFebruary 21, 2026
Repositoryblader/claudeception

What it does

Find the real stack trace behind a silent Next.js server-side 500 by checking the terminal and provider logs.

Who is it for?

Debugging silent 500s in getServerSideProps, getStaticProps, or Next.js API routes.

Skip if: Client-side errors in useEffect or event handlers, which do appear in the browser console.

When should I use this skill?

A Next.js page shows a generic error or 500 but the browser console is empty, especially on refresh or direct navigation.

What you get

The developer finds the real error and full stack trace in the terminal or provider logs instead of a generic 500.

  • The real server-side error identified from terminal or provider logs

By the numbers

  • 4-step debugging solution
  • 5 common causes listed

Files

SKILL.mdMarkdownGitHub ↗

Next.js Server-Side Error Debugging

Problem

Server-side errors in Next.js don't appear in the browser console, making debugging frustrating when you're looking in the wrong place. The browser shows a generic error page or 500 status, but no stack trace or useful error information appears in DevTools.

Context / Trigger Conditions

This skill applies when:

  • Page displays "Internal Server Error" or custom error page
  • Browser console shows no errors, or only a generic fetch failure
  • You're using getServerSideProps, getStaticProps, or API routes
  • Error only occurs on page refresh or direct navigation (not client-side transitions)
  • The error is intermittent and hard to reproduce in the browser

Common misleading symptoms:

  • "Unhandled Runtime Error" modal that doesn't show the real cause
  • Network tab shows 500 but response body is empty or generic
  • Error disappears when you add console.log (timing issue)

Solution

Step 1: Check the Terminal

The actual error with full stack trace appears in the terminal where npm run dev or next dev is running. This is the first place to look.

# If you don't see the terminal, find the process
ps aux | grep next
# Or restart with visible output
npm run dev

Step 2: Add Explicit Error Handling

For persistent debugging, wrap server-side code with try-catch:

export async function getServerSideProps(context) {
  try {
    const data = await fetchSomething();
    return { props: { data } };
  } catch (error) {
    console.error('getServerSideProps error:', error);
    // Return error state instead of throwing
    return { props: { error: error.message } };
  }
}

Step 3: For Production Errors

Check your hosting provider's logs:

  • Vercel: Dashboard → Project → Logs (Functions tab)
  • AWS: CloudWatch Logs
  • Netlify: Functions tab in dashboard
  • Self-hosted: Check your Node.js process logs

Step 4: Common Causes

1. Environment variables: Missing in production but present locally 2. Database connections: Connection string issues, cold starts 3. Import errors: Server-only code accidentally imported on client 4. Async/await: Missing await on async operations 5. JSON serialization: Objects that can't be serialized (dates, functions)

Verification

After checking the terminal, you should see:

  • Full stack trace with file name and line number
  • The actual error message (not generic 500)
  • Variable values if you added console.log statements

Example

Symptom: User reports page shows "Internal Server Error" after clicking a link.

Investigation: 1. Open browser DevTools → Console: Empty 2. Network tab shows: GET /dashboard → 500 3. Check terminal running npm run dev:

Error: Cannot read property 'id' of undefined
    at getServerSideProps (/app/pages/dashboard.tsx:15:25)
    at renderToHTML (/app/node_modules/next/dist/server/render.js:428:22)

Cause found: Database query returned null instead of user object.

Notes

  • In development, Next.js sometimes shows an error overlay, but it often has less

detail than the terminal output

  • reactStrictMode: true in next.config.js causes double-execution of server

functions in development, which can make debugging confusing

  • For API routes, the error appears in the same terminal as page errors
  • Client-side errors (in useEffect, event handlers) DO appear in browser console—

this skill only applies to server-side code

  • If using next start (production mode locally), errors may be less verbose;

check NODE_ENV and consider adding custom error logging

Related skills

FAQ

Where do Next.js server-side errors actually appear?

In the terminal running next dev or npm run dev, with the full stack trace, not in the browser console.

Where do I find production server-side errors?

In your host's logs: Vercel Functions logs, AWS CloudWatch, Netlify Functions tab, or your Node.js process logs.

Debuggingbackendfrontend

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.