Stack trace formatter
Paste a JavaScript, Python, Ruby or Go stack trace and this tool splits it into one frame per line, marks which frames are your code and which are libraries, and puts the error message first.
Formatted
[JAVASCRIPT] 6 frames, 2 yours, 4 library
TypeError: Cannot read properties of undefined (reading 'email')
- [APP]formatUser/app/src/users/format.js:14:23
- [LIB]Array.map<anonymous>
- [APP]listUsers/app/src/users/list.js:31:18
- [LIB]Layer.handle [as handle_request]/app/node_modules/express/lib/router/layer.js:95:5
- [LIB]next/app/node_modules/express/lib/router/route.js:149:13
- [LIB]processTicksAndRejectionsnode:internal/process/task_queues:95:5
What each language looks like
JavaScript (V8): at render (/app/src/ui.js:12:5)
JavaScript (other): render@https://example.com/app.js:12:5
Python: File "/srv/app/main.py", line 42, in handle
Ruby: from app/models/order.rb:27:in 'total'
Go: main.handle(0x0)
/home/me/api/server.go:58 +0x41How to use it
- Paste the trace as it came out of your terminal, log file, bug report or browser console. Leading spaces, Windows line endings and wrapped lines are fine.
- The language is detected from the shape of the lines: "at" lines for JavaScript, File lines for Python, in-method lines for Ruby, function plus file pairs for Go.
- Read the error message at the top, then the frames. Frames from your code are marked APP with a bar on the left, frames from packages and the runtime are marked LIB and dimmed.
- If your own files are marked as library code, type the folder they live in, for example /app/src, and every frame outside it is treated as a library.
- Tick Hide library frames to keep only your code, then copy the result as plain text for an issue or a chat message.
Questions
- Which stack trace formats does it read?
- JavaScript from Chrome, Edge and Node (at function (file:line:col)) and from Firefox and Safari (function@file:line:col), Python tracebacks with their code lines, Ruby backtraces in the old and new quote styles, and Go panics and goroutine dumps.
- How does it decide which frames are my code?
- Paths containing node_modules, site-packages, gems, vendor, the Go standard library or Node internals count as library code. Everything else is yours. Type your project folder to override this: frames inside it count as yours, except dependency folders such as node_modules under it.
- Why does Python print the most recent call last?
- Python lists frames from the outermost call down to the line that raised, so the error is at the bottom. Go does the reverse inside each goroutine. Tick the option to show the frame that threw first if you prefer to read from the top.
- Does it change line numbers or file names?
- No. It only reorders and labels what you paste. If the trace comes from minified code, decode it with a source map first.
- Is my trace sent anywhere?
- No. Parsing happens in JavaScript in this tab, and nothing is uploaded. Paths and messages in traces can be sensitive, which is one reason to keep this local.