Day 6 Task 02 AI Debugging

Task 02. Error Resolution Assistant (AI Debug Assistant)

Codex AI quickly reads various runtime error messages encountered during development and applies defense codes.

Task 02 Task 02 Error Resolution Assistant Practice Guide

📥 Practice Input

  • day6_meeting_notes.md (meeting minutes)

💾 Practice output (Output)

  • day6_debug_solution.js

1. Story and practice background

I wrote JavaScript code to pop up the screen and have fun fetching API data. However, when I clicked refresh on the browser, the screen stopped white and the console window appeared. TypeError: Cannot read properties of undefined (reading 'map')The error message is filled with red. The junior developer looked at the code dozens of times without knowing the cause, and even when he typed a message in the Google search box, he only got answers in English that did not fit his situation, which ultimately left him frustrated.

More than half of development is the 'debugging' process of finding and fixing errors. Beginners waste a lot of time because they lack the ability to read and interpret error logs, which are clues to errors. In this exercise, we will deliver the error phenomenon, error log, and execution code that occurred to Codex to accurately pinpoint the fundamental point of occurrence of the problem and prescribe measures to correct it immediately.

2. Learning objectives

  • You can determine the type of problem by reading error messages in the browser console and server log.
  • Develop logical debugging habits that analyze the cause and path of errors (Stack Trace).
  • Safe defensive coding can be directly applied based on the error analysis report proposed by AI.

🛠️Practical guide to follow along

  1. Create file for practice: Click the download button below day6_meeting_notes.md file automation/ Save it within the folder.
  2. Codex debugging request: Request a diagnosis by sending the **Codex request prompt** below to the Codex Client prompt input window.
  3. Apply error patch: Diagnose the cause of the Codex, apply conditional guards, and highly readable code to the local source and refresh to verify that the error has disappeared.

Download practice materials

Codex request prompt

Task 02 Prompt
The error 'TypeError: Cannot read properties of undefined (reading 'map')' occurred in the code you wrote. Please compare the provided source code day6_debug_source.js with the console error log to explain why the error occurred from a beginner's perspective, and provide a modified source with defense code that can completely control the error.

4. Example results

Codex analyzes the meeting transcript and outputs normalized data entity mappings and a Mermaid ERD script as shown below.

file nameerror phenomenonmain causesprescriptive action
day6_debug_source.jsTypeError: Cannot read properties of undefined (reading 'map')Empty value (undefined) reference due to data fetch delayOptional chaining and exception branch handling

5. AI utilization points

  • Error context analysis: Infers the context of not only simple typos (syntax errors) but also atypical runtime exceptions that occur due to call order or asynchronous execution timing (Asynchronous Flow).
  • Debugging process guide: Rather than simply providing a solution code, it provides conceptual and educational explanation on 'Why did an error occur in this line?'