General

What Does This Error Actually Mean? Decoding Python and JavaScript Errors in Plain English

2026-12-04 · 5 min · Lint Team

Error messages are written for the person who wrote the library, not for you at 1am. The good news: most errors you will ever see belong to a small set of patterns, and each pattern has a usual cause and a usual fix. This article decodes five of the most common Python and JavaScript errors in plain English — what the message actually means, why it happens, and what to change.

Staring at an error right now? Paste it in and get a plain-English explanation plus the usual fix — 72 known patterns, no account.

Decode my error →Free, no signup for your first checks.


How to read an error in 20 seconds



Before the specifics, three habits that make any error smaller:

  • Read the last line first. In a Python traceback, the final line is the exception type and message. Everything above it is just the path your code took to get there.
  • Find your own frame. Scan the traceback for the first file that is yours, not the library's. That line is almost always where the fix belongs.
  • Name the type. TypeError, KeyError, and ModuleNotFoundError are different problems with different fixes. The type tells you which toolbox to open.


1. TypeError: unsupported operand type(s) for +: 'int' and 'str' (Python)



TypeError: unsupported operand type(s) for +: 'int' and 'str'


What it means: you tried to add a number and a piece of text with +, and Python refuses to guess which one you meant. Unlike JavaScript, Python never converts between numbers and strings implicitly.

Usual cause: one operand came from somewhere that produces strings — input(), a form field, a CSV cell, or a JSON value you assumed was numeric.

The fix: convert explicitly, or format instead of adding. total = count + int(value) if you want arithmetic; f"{count}{value}" if you wanted text. If you are not sure which operand is the string, print type(x) for both at the failing line — the answer is never ambiguous after that.

2. KeyError: 'user_id' (Python)



KeyError: 'user_id'


What it means: you asked a dictionary for a key it does not have. The quoted name is the exact key that was missing.

Usual cause: a typo (userId vs user_id), a field that was renamed upstream, or an optional field that is simply absent in some payloads. API responses are the classic source: the key exists in the happy-path example you tested with, and not in production data.

The fix: decide whether the key is required or optional. If optional, use data.get("user_id") with a sensible default. If required, validate the payload at the boundary where it enters your code and fail with a message that names the missing field — future you will thank present you. Printing sorted(data.keys()) once during debugging settles most arguments about what the payload actually contains.

3. ModuleNotFoundError: No module named 'requests' (Python)



ModuleNotFoundError: No module named 'requests'


What it means: the Python interpreter running your code cannot find a package with that name. Note the wording: it says nothing about whether the package is installed *somewhere* on your machine — only that this interpreter cannot see it.

Usual cause: three candidates cover almost every case. The package is not installed; it is installed in a different virtual environment than the one running the script; or a file in your project directory shadows the package name (a local requests.py or email.py will win over the real library).

The fix: check which interpreter is actually running with import sys; print(sys.executable), install into that environment (python -m pip install requests uses the right pip by construction), and rename any local file that collides with a library name.

4. TypeError: x is not a function (JavaScript)



TypeError: response.json is not a function


What it means: you called something with () that is not callable. The value exists — it is just not a function. In this example, response.json is being called on something that is not a fetch Response, often because an await is missing and you are holding a Promise instead.

Usual cause: a missing await, a wrong import (default vs named export), a method name typo, or a variable that was overwritten with data earlier in the function.

The fix: log typeof x and the value itself right before the failing line. Nine times out of ten the log shows a Promise, undefined, or a plain object — and the fix (add await, fix the import, rename the variable) becomes obvious.

5. CORS: blocked by CORS policy (browser JavaScript)



Access to fetch at 'https://api.example.com/data' from origin 'https://app.example.com' has been blocked by CORS policy


What it means: the browser refused to let your page read the response because the API server did not say your origin is allowed. This is a browser security rule doing its job, not a server crash — the request often reached the server fine.

Usual cause: the API has no CORS headers, or allows a different origin (a staging domain, localhost with a different port). The giveaway: the same request works in Postman or curl, because those tools do not enforce CORS.

The fix: configure CORS on the server to allow your specific origin (Access-Control-Allow-Origin: https://app.example.com), including handling the preflight OPTIONS request for non-simple requests. Do not "fix" it by disabling browser security or routing through a random public proxy — both turn a configuration task into a security problem.

When the message alone is not enough



Honest limit: the same message can have different root causes, and some errors only make sense with the full traceback and the failing line in view. A decoder can tell you what a message *usually* means; confirming which cause applies to your code still takes one look at the actual values involved. If you want to get better at that part, our guides on reading a Python traceback without panicking and decoding TypeScript error codes go deeper.

For the error in front of you right now: paste it into the free error decoder and get the plain-English version plus the usual fix. If it gets yours wrong, that is exactly the feedback that makes the pattern list better.

Common errors, decoded one by one



The five patterns above cover most of what you will meet, but each error deserves its own page when you need the full fix. This series grows one error at a time:



More single-error pages are on the way (ModuleNotFoundError and CORS are next). If the error in front of you is not listed yet, the free error decoder handles 72 known patterns.
📌 Prices and tool count in this article may be outdated. Lint now ships 16 tools with Pro at $12/mo, or $39/year founding. See the current pricing page.
Try Lint free — no signup, code-aware
Free · no account needed · open full toolkit →
L
Lint Team
Lint Tools — AI writing for developers

Stop letting Grammarly break your code

18 AI and browser tools built for developers. Code-aware parsing.

Try free — no signup View pricing
Or upgrade to Pro for 500 checks a day · All tools · No ads

Need more than free tools?

Unlock 500 checks a day, larger text capacity, and priority support.

View pricing → Upgrade Lint — Pro $12/mo or $39/yr founding
💬