Websites, apps & code / Coding & debugging

Fix an error message

Your code will not run and shows a wall of red text.

Fill in your details

Leave blank to use the example. Names are remembered for other prompts too (stored only on your device).

Variation:Language or tool

Prompt

My code gave an error, please help.

Using: Explain where to find the error in the browser developer tools.
Error message:
TypeError: Cannot read properties of undefined (reading 'name')
What I just did: I swapped in a new customer sheet then pressed Start

Please:
1. Explain in plain words what the error means.
2. List the 3 most likely causes, most likely first.
3. Tell me what to check first, one thing at a time, and I will report back.
4. Ask me for the code when you need it; do not imagine it.
5. Once fixed, tell me why it happened and how to avoid it next time.
Do not ask me to paste passwords, API keys, IC numbers or customer data; if my code contains any, remind me to replace them with [FAKE] values first.

Paste it into ChatGPT, Gemini, Claude or Meta AI.

Test result

Run on 2026-12-01 with Claude Sonnet 5.5 (variation: JavaScript or web), using the example details above. AI never answers word for word the same twice, but the shape stays close.

What we noticed

The AI explained the error in plain words and listed 3 causes (column names, empty or shorter sheet, data not loaded yet). It only asked for the console line number first. With no code pasted, the causes are guesses not yet verified.

See what the AI actually wrote

This error is very common. First in plain words, then we check step by step.

1. What the error means:
TypeError: Cannot read properties of undefined (reading 'name') means the code tried to read the "name" of something, but that something is empty (undefined, meaning "not there"). For example the code expects a customer and reads customer.name; but no customer was found, so there is no name to read and it stops with an error.

2. The 3 most likely causes (most likely first):

  1. The new customer sheet has different column names from what the code expects (the old one said name, the new one says Name or something else), or the new sheet's first row is a heading that the code treats as data.
  2. The new sheet is empty or has fewer rows than the old one, but the code reads as many rows as before, so at row N there is nobody left.
  3. When you press Start, the new data has not finished loading and the code reads too early.

3. What to check first (one thing at a time):
Step one: find which line the error is on. In the browser press F12 (on Mac Command + Option + I) and click "Console". The red error text has a file name and line number on its right, such as app.js:42. Please tell me that line number and the text beside it.
Do not change anything yet; just tell me what you see.

4. When I need to see the code: once you give me the line number I will ask you to paste those few lines (replace any passwords, keys or customer data with [FAKE] first). I will not imagine what your code looks like.

5. After it is fixed: I will explain why it happened and how to avoid it, for example checking that something exists before reading it, and comparing column names whenever you swap in a new sheet.

Do step one and tell me the red text and line number from the console.

AI tools that suit this

  • Claude Suggested tool Free plan

    Strong at long documents, editing and code

  • ChatGPT Suggested tool Free plan

    The most widely used AI chat, for writing, questions and images

  • Cursor Suggested tool Free plan

    AI code editor

  • Gemini Suggested tool Free plan

    Google's AI; generates and edits images, works with Gmail and Docs

Recommendations only, not sponsored. Check each site for what the free plan includes.

This site is made by FullMark Tech

Want your own website, or your shop spreadsheets automated? FullMark Tech builds business websites and custom Excel tools.

Ask on WhatsApp See FullMark Tech services