nextjs-server-side-error-debugging

Surface full server-side error stack traces from Next.js development logs.

1|Updated Jan 23, 2026
One-click install
npx skills add https://github.com/Hankanman/claude-config --skill nextjs-server-side-error-debugging-hankanman
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: nextjs-server-side-error-debugging
Source: https://github.com/Hankanman/claude-config/tree/main/config/skills/claudeception/examples/nextjs-server-side-error-debugging
Command: npx skills add https://github.com/Hankanman/claude-config --skill nextjs-server-side-error-debugging-hankanman

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

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.

Core Features & Use Cases

  • Diagnose issues in getServerSideProps, getStaticProps, and API routes by inspecting terminal logs.
  • Provide steps to wrap server-side code with try-catch and to log errors to the console.
  • Identify common causes: missing environment variables, database connection issues, import errors, and JSON serialization problems.

Quick Start

Run the project in development mode and review the terminal logs for the full error stack. Then apply targeted fixes (wrap server-side code in try-catch, log errors, and verify getServerSideProps/getStaticProps/API route implementations).

Frequently Asked Questions about nextjs-server-side-error-debugging

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I debug Next.js server-side errors when the browser only shows a 500 status?

Next.js server-side errors are debugged by inspecting terminal logs during development mode, because the browser only displays a generic 500 error page without the actual stack trace or error details.

Why does my Next.js getServerSideProps function fail on direct navigation but not during client-side routing?

Next.js getServerSideProps errors during direct navigation or refresh are often caused by missing environment variables, database connection failures, or JSON serialization problems that only execute on the server side.

What is the best way to surface real stack traces for Next.js API routes during development?

The best way to surface real stack traces for Next.js API routes is to wrap your server-side code in explicit try-catch blocks and log the caught errors directly to the console to review them in your terminal.

Do I need to add try-catch blocks to getStaticProps to identify server-side import errors?

Yes, adding explicit try-catch error handling and logging to getStaticProps helps surface server-side import errors and other issues in terminal logs that are otherwise invisible in the browser DevTools.

What are common causes of generic error pages in Next.js applications?

Common causes of generic error pages in Next.js applications include missing environment variables, database connection issues, import errors, and JSON serialization problems within getServerSideProps, getStaticProps, or API routes.