JavaScript Error Decoder
Paste an error from the browser console or a Node.js terminal and get a plain-English explanation. The decoder recognises about thirty common errors, from “Cannot read properties of undefined” to CORS, invalid JSON and React hydration problems, lists the usual causes and fixes, and turns the stack trace into a numbered list that points at the first line of your own code instead of library internals.
- Runs in your browser
- No sign-up
- Free to use
How to use JavaScript Error Decoder
- Copy the complete error from the console, including the “at …” lines.
- Paste it into the left box.
- Read what the error means and how to fix it.
- Open the file and line marked “START HERE”.
JavaScript Error Decoder features
Common errors explained
TypeError, ReferenceError, SyntaxError, RangeError, CORS, fetch and JSON errors.
Causes and fixes
The usual reasons for each error and concrete steps to fix it.
Stack trace decoding
Chrome, Edge, Node.js, Firefox and Safari formats.
Your code first
Library frames are marked so you can find your own line quickly.
Framework messages
React keys, re-render loops and hydration mismatches.
Private
Errors are analysed in your browser and never uploaded.
When to use JavaScript Error Decoder
- Understanding an unfamiliar error in a project you just joined.
- Explaining a bug report that contains a stack trace.
- Learning what common JavaScript errors mean.
- Finding the relevant line in a long trace full of framework frames.
JavaScript Error Decoder FAQ
What does “Cannot read properties of undefined” mean?
The code reads a property, such as .map or .name, from a value that is undefined. The object to the left of the dot does not exist yet, usually because data has not loaded or a name is misspelled.
Why does the trace contain so many library lines?
Frameworks call your code through many internal functions. The decoder marks frames from node_modules, bundler dependencies and Node.js internals as library frames, and points to the first frame from your own files.
What if my error is not recognised?
You still get the decoded stack trace and a general explanation of the error type. Search for the exact message together with the library name for very specific errors.
Does it work with minified code?
The explanation does, but file names and line numbers of minified bundles are hard to read. Enable source maps in development to get original file names in the console.
Can it read Firefox and Safari traces?
Yes. Both the “at function (file:line:col)” format of Chrome and Node.js and the “function@file:line:col” format of Firefox and Safari are understood.
Is my error sent anywhere?
No. The decoder runs entirely in your browser, so file paths and data in messages stay private.
Reading JavaScript errors
A JavaScript error has two parts. The first line names the error type and gives a message: TypeError for values of the wrong type, ReferenceError for names that do not exist, SyntaxError for code that cannot be parsed and RangeError for numbers outside the allowed range. The lines below form the stack trace, the chain of function calls that led to the error, with the most recent call first.
The message usually tells you what went wrong but not why. “Cannot read properties of undefined (reading 'map')” means something.map was used where something is undefined, which in practice nearly always means data that has not arrived yet, an API response with a different shape than expected, or a typo higher up. The decoder matches the message against a list of common errors and explains these typical causes together with the steps that fix them.
Some messages describe problems outside the code itself. “Failed to fetch” means the request never completed, “blocked by CORS policy” means the server did not allow the request, and “Unexpected token < in JSON” almost always means a server returned an HTML page where JSON was expected. Knowing this saves time spent searching the code for a bug that lives in the network or on the server.
Stack traces are easier to use once library frames are separated from your own. In a React, Vue or Node.js application most frames belong to the framework, and the useful one is the first frame from your own files. The decoder parses each frame into a function name, file, line and column, marks dependencies, and points to the first frame from your own code as the place to start.
Errors thrown inside promises appear as “Uncaught (in promise)” followed by the real error, and errors from scripts on other domains may appear only as “Script error.” with no details. The decoder explains both cases, including what to change so that the browser shows the full information next time.