Playing Through Errors

Lessons HTML Book Chapter 5
HTML Book · Chapter 5

Stuck? How to Play Through the Errors

In the sandbox, we have a completely different name for errors: we call them landmarks. An error isn’t a penalty card — it’s a GPS ping telling you exactly where the edge of the digital map is.

Chapter 5 of 5

Errors are landmarks, not failures.

In a traditional computer science class, when a student runs their code and a red error message pops up, a dark cloud fills the room. The student freezes. They feel like they did something wrong — or worse, that they aren’t “smart enough” to be a programmer.

In the sandbox, that red message means something completely different. It means you found an edge. You pushed far enough to discover a boundary that most people never reach because they never play hard enough to get there.

If you aren’t breaking your application on purpose at least once an afternoon, you aren’t playing hard enough.

The Developer Console.

Before you ask the AI for help, you should learn how to see what your browser is thinking. Every web browser has a hidden dashboard called the Developer Console — a flight data recorder for your web page.

1
Open your file in the browser

Double-click your equalizer.html file so it opens in Chrome, Edge, or Firefox.

2
Right-click → Inspect

Right-click anywhere on the page and select Inspect or Inspect Element. A panel will slide open on the side or bottom of your screen.

3
Click the Console tab

Look at the top of the panel and click the tab labeled Console. If your code is broken, you’ll see a bright red line of text waiting for you.

🔴
That red line is a puzzle piece, not a scolding.

It might say something like Uncaught ReferenceError: particle is not defined at equalizer.html:42. Don’t try to memorize what that means. You don’t have to. Just copy it.


The Three-Step Debugging Loop.

When things stop working, follow this blueprint with your AI assistant. It works every time.

Step 1
Copy the Error — Don’t Guess

Don’t guess what went wrong. Don’t try to type out code from memory. Triple-click that red error line in your browser console — this selects the whole line — then copy it.

The Rule

Paste the exact error text into your AI chat alongside your current file. Precision here saves you fifteen minutes of going in circles.

Step 2
Use the “Plain English” Recipe

Feed the AI a prompt that forces it to explain the boundary — not just hand you a quick patch you don’t understand.

Your debugging prompt — copy this

“My sandbox application stopped working. My browser console shows this exact error: [paste your red error line here].

Here is my current code: [paste your entire HTML file here]

Can you explain in plain English: 1. What boundary did I accidentally cross to trigger this error? 2. How did the browser’s logic get confused? 3. Give me the corrected version of the full file so I can paste it back into Notepad and keep playing.”

Why this wording works Asking for plain English forces the AI out of patch mode and into teaching mode. You’ll almost always learn something genuinely useful — not just get a silent code swap.
Step 3
Observe the Fix

When the AI gives you corrected code, don’t just blindly paste it in. Read its explanation first.

What you’ll usually find

Something incredibly small happened. You accidentally deleted a single comma, capitalised a word that needed to be lowercase, or set a slider minimum to a value that forced a maths calculation to divide by zero. The fix is almost always one character — the understanding is the whole point.


The Scale Back Rule.

If you ask the AI to add three complicated features at once — bouncing particles, colour-on-click, and a sound effect — and the whole thing breaks, it can be very hard to tell which feature caused the collapse. Sometimes the AI itself gets tangled trying to fix its own code.

When that happens, invoke the Scale Back Rule.

The Scale Back prompt

“Let’s pause. Strip away the sound effect and the click features. Let’s go back to the absolute simplest working version of our particle canvas first. Once that is working smoothly, we will add the new features back in one by one.”

🧱
Build incrementally. Always.

By scaling back, you isolate your experiments. You learn exactly which brick changed the system — and that keeps you in complete control of the sandbox.


The same skills professionals use every day.

Everything in this chapter is real debugging practice. These aren’t simplified beginner habits you’ll have to unlearn — they’re exactly how experienced developers work.

📍
Errors as Landmarks
A broken screen isn’t failure — it’s feedback. Every error message is the browser telling you precisely where the edge of the map is.
🖥️
The Developer Console
Every browser has a flight data recorder built in. Right-click → Inspect → Console. That red line is your most useful piece of information.
📋
Precise Error Reporting
Copying the exact error and pasting it to your AI is the difference between a ten-second fix and a twenty-minute guessing game.
🧱
Incremental Building
Add one feature at a time. When something breaks, you know exactly which brick moved. That’s not caution — that’s control.
The developer who never breaks anything isn’t experimenting hard enough. The developer who knows how to read what broke — and why — is unstoppable.
You’re in HTML Book · Chapter 5 of 5
Play-First Programming · playfirstprogramming.com A clubhouse for curious builders