본문으로 건너뛰기
cccskills
무료GitHub에 공개

debugging-error-tracking

Systematic debugging workflow for errors, performance issues, and runtime problems in the portfolio.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(1)

  • SKILL.md5.9 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Debugging & Error Tracking

When to use this skill

  • Investigating console errors or warnings
  • Debugging hydration mismatches
  • Tracking down performance regressions
  • Diagnosing network request failures
  • Analyzing memory leaks or slow render cycles
  • Troubleshooting browser-specific issues

Workflow

1. Error triage

Classify the error:

CategoryExamplesPriority
Build-timeTypeScript errors, lint failures, missing importsFix before commit
RuntimeConsole errors, unhandled promises, null referencesFix before deploy
HydrationServer/client HTML mismatch, useEffect missingFix before deploy
NetworkAPI failures, CORS errors, timeoutFix based on user impact
PerformanceSlow LCP, high CLS, janky animationsFix if regression
Browser-specificSafari-only, mobile-only, Firefox-onlyFix if significant audience

2. Console error investigation

Step 1: Reproduce the error

  • Open browser DevTools → Console tab
  • Clear console and reload the page
  • Note the exact error message, file, and line number

Step 2: Read the error carefully

  • The first line is the error type (TypeError, ReferenceError, etc.)
  • The second line is usually the component stack trace
  • Look for the file path and line number in the source

Step 3: Check common patterns

Error patternLikely causeFix
Cannot read property of undefinedNull data from APIAdd null checks or ?? defaults
Hydration mismatchServer/client render differenceAdd useEffect guard, mounted state
Too many re-rendersState update in renderMove to useEffect or callback
Invalid hook callConditional hook or wrong ReactEnsure hooks are called unconditionally
404 on _next/staticStale service workerClear SW cache (see PWA skill)
CORS errorMissing headersCheck API route CORS config

3. Hydration mismatch debugging

Symptoms: Warning in console about hydration mismatch, content flickers on load.

Common causes:

  1. Date/time rendering -- Server and client generate different strings

    // BAD: server and client time differ
    <span>{new Date().toLocaleDateString()}</span>
    
    // GOOD: render only on client
    const [mounted, setMounted] = useState(false);
    useEffect(() => setMounted(true), []);
    <span>{mounted ? new Date().toLocaleDateString() : ''}</span>
    
  2. Browser extensions -- Extensions inject elements into the DOM

    • Test in incognito mode with extensions disabled
  3. Conditional rendering based on window/document

    // BAD
    <div>{typeof window !== 'undefined' ? 'client' : 'server'}</div>
    
    // GOOD: use useEffect
    const [isClient, setIsClient] = useState(false);
    useEffect(() => setIsClient(true), []);
    

4. Network request debugging

DevTools → Network tab:

  1. Filter by Fetch/XHR to see API calls
  2. Check the Status column for failures (4xx, 5xx)
  3. Click the failed request → Preview tab for error details
  4. Check Response Headers for CORS issues

Common network issues:

StatusMeaningFix
400Bad requestCheck request body/params
401UnauthorizedCheck API token
403ForbiddenCheck permissions/CORS
404Not foundCheck the API route exists
429Rate limitedAdd retry logic, back off
500Server errorCheck server logs
CORS errorMissing Access-Control-Allow-OriginAdd CORS headers to API route

5. Performance debugging

Chrome DevTools → Performance tab:

  1. Click record, interact with the page, stop recording
  2. Look for long tasks (red bars in the timeline)
  3. Check the Summary tab for breakdown (scripting, rendering, painting)

React DevTools → Profiler:

  1. Open React DevTools → Profiler tab
  2. Click record, interact, stop
  3. Check which components re-rendered and why
  4. Look for components rendering too often (unnecessary re-renders)

Quick performance checks:

# Lighthouse audit
npx lighthouse http://localhost:3000 --output html --view

# Bundle size check
npm run build 2>&1 | grep -E "First Load|shared"

6. Memory leak detection

DevTools → Memory tab:

  1. Take a heap snapshot
  2. Perform actions (navigate, open modals, etc.)
  3. Take another snapshot
  4. Compare snapshots -- look for detached DOM nodes

Common memory leak sources:

  • Event listeners not cleaned up in useEffect return
  • setInterval not cleared
  • SWR fetchers holding references
  • Third-party widgets (analytics, chat) not disposed

7. Mobile debugging

Chrome DevTools → Toggle Device Toolbar:

  1. Select a device preset (iPhone, Pixel, etc.)
  2. Check for touch event issues
  3. Verify tap targets are ≥ 44px
  4. Test scroll behavior (iOS momentum scrolling)
  5. Check for viewport meta tag issues

Remote debugging (real device):

  • Android: chrome://inspect with USB debugging
  • iOS: Safari → Develop → [device]

Quick reference

ProblemFirst thing to check
Page is blankConsole errors, build errors
Data not loadingNetwork tab, API routes
Styling brokenTailwind classes, dark mode toggle
Slow pagePerformance tab, bundle size
Works on desktop, broken on mobileResponsive breakpoints, touch events
Works in Chrome, broken in SafariCSS features, JS compatibility
Intermittent errorRace conditions, async timing

Delivery checks

  • Console is clean (no errors or warnings)
  • Network tab shows no failed requests
  • Hydration warnings are resolved
  • Performance metrics are within targets (LCP < 2.5s, CLS < 0.1)
  • Tested on mobile viewport
  • Tested in incognito (no extension interference)

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Audit and fix accessibility issues across the portfolio to ensure WCAG 2.1 AA compliance.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

PP-Namias/Portfolio22026년 10월 16일 업데이트

Creates a new blog post document in the Sanity studio. Use when the user wants to write a blog post, publish an article, or schedule a future post.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

PP-Namias/Portfolio22026년 10월 16일 업데이트

Creates a new certification document in the Sanity studio. Use when the user wants to add a credential, certificate, or professional accreditation to the Certifications collection.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

PP-Namias/Portfolio22026년 10월 16일 업데이트

Adds a new skill MD file to the studio's skills collection. Use when the user wants to author a new step-by-step recipe for the studio's in-app Skills tool or the .agents mirror.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

PP-Namias/Portfolio22026년 10월 16일 업데이트

Creates a new project document in the Sanity studio. Use when the user wants to add a new portfolio project, a case study, or a work sample to the Projects collection.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

PP-Namias/Portfolio22026년 10월 16일 업데이트

Creates a new experience document in the Sanity studio. Use when the user wants to add a job, role, internship, or work history entry to the Experience collection.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

PP-Namias/Portfolio22026년 10월 16일 업데이트

PP-Namias의 스킬 모두 보기

이 스킬의 문제 신고