Reading Errors From Online Code Runners (6 Languages)
When a run fails, the hard part is usually not fixing the bug but deciding which layer it came from - compilation, execution, or the environment. These six languages fail in very different ways inside a browser, and each needs a different reading.
- Python runs locally through Pyodide, so errors are standard tracebacks and nothing is uploaded - but there is no stdin, so input() raises immediately
- C++, Java, Go and Shell execute on a remote gateway, where compile errors and runtime errors appear separately and a failed compile produces no program output at all
- A non-zero exit code is the failure signal, and a bash script does not stop when one command fails unless set -e is set at the top
- The elapsed time in the status bar is the round trip from request to result, including remote queueing and compilation, so it does not mean your code is slow
- When the gateway is unavailable the tool falls back to a backup service, and two stacked error messages mean both layers failed
#Work out which layer failed first
A failure inside an online runner belongs to one of three layers: compile, runtime, or environment. The cause and the fix differ completely, and reading them mixed together only makes things worse.
The six languages stack these layers differently: compiled languages have a distinct compile phase, Python and Shell go straight to execution, and Python is the only one that runs in your browser.
| Layer | What you see | What to do |
|---|---|---|
| Compile | No program output at all, just compiler messages | Fix syntax, ignore logic for now |
| Runtime | Output stops partway, or exit code is non-zero | Read the traceback or exception type |
| Environment | Missing package, no stdin, timeout, sandbox limit | Change the approach or the tool, not the code |
Do not suspect your logic when the output is empty. A failed compile means the program never started, so of course there is no output - what you are reading is the compiler talking, not your program.
#Python: local execution, familiar errors
Python runs in the browser through Pyodide, a CPython build compiled to WebAssembly, so nothing is uploaded and errors are standard tracebacks. The runtime is a download of a dozen or so megabytes on first use, then it is cached.
Two differences from a local setup get mistaken for bugs:
- No standard input. Pyodide binds no stdin, so
input()raises. Put the input in a constant if you want to demonstrate an interactive program. - Limited packages. Only what Pyodide precompiles is available; the standard library is complete and common libraries like
numpyusually work. AModuleNotFoundErroris almost always this, not your mistake.
Execution uses runPythonAsync, so top-level await works without wrapping an event loop. Stdout and stderr are merged in order rather than appearing as two separate streams like a terminal.
If you genuinely need stdin, use the Python runner for everything else and switch to the C++, Java, Go or Shell tools - they provide an input box.
#Compiled languages: no compile, no output
C++, Java and Go all compile first, so a syntax error means your program never ran once. That sounds trivial, but it is the most common answer to "why is there no output".
These tools call a gateway at run.dsjson.com and fall back to a backup service when it is unavailable. Code leaves the browser, so never include passwords, keys or internal addresses.
The elapsed time misleads people: the status bar measures the round trip from request to result, including remote queueing and compilation. Hundreds of milliseconds to a few seconds is normal and says nothing about your algorithm.
// A compile error: expect no program output whatsoever
#include <iostream>
int main() {
std::cout << "hi" << std::endl // missing semicolon
return 0;
}With the C++ runner, Java runner and Go runner, whatever sits in the stdin box is passed to the program, so cin, scanf, Scanner and bufio.Reader all read it normally.
When both the gateway and the backup fail, the two error messages are stacked together. That is by design - it is the only signal telling you whether the problem is the network or the service.
#Shell: read the exit code
A shell script has no compile phase, so every failure is a runtime failure and the exit code is the most reliable signal. A non-zero exit is displayed, and stderr is shown separately from stdout.
One behaviour difference trips people up: bash does not stop when a command fails by default. It keeps going, and only the last command's status becomes the script's exit code. For fail-fast behaviour you must write set -e at the top.
The script runs in a throwaway sandbox, so these will not behave as expected:
- Your filesystem is absent, so local paths are meaningless
- Your environment variables are absent, so secrets and config reads come back empty
- Your internal network is unreachable, so
curlagainst an intranet host just times out
That is an environment limit rather than a syntax error - only a different environment can verify it.
The Shell runner is well suited to checking syntax, string handling, loops and pipelines, and read does pick up input from the stdin box.
#JavaScript: module syntax raises false hints
JS executes locally with immediate errors, but its syntax hints have one predictable false positive: top-level import and export. That is because the check compiles your code with new Function, treating it as a function body.
- Top-level
import/exportraise a hint, because ESM syntax cannot appear inside a function body. - A top-level
returndoes not, because it is legal there.
When you see such a hint, check whether the code is module syntax before editing anything. It is not a linter: logic errors and undefined variables are never reported.
Use the JavaScript runner to check an algorithm quickly, and the text diff to compare the output of two versions.
#Which tool to use
| What you need | Tool | Key difference |
|---|---|---|
| Run a Python script or check an algorithm | Python runner | Local, nothing uploaded, no stdin |
| Verify a piece of JS logic | JavaScript runner | Local execution, module syntax misreports |
| Confirm code compiles for a course | C++ runner | GCC 13.2.0, stdin supported |
| Practise Java classes and collections | Java runner | Remote compile, fix compile errors first |
| Check standard library or concurrency usage | Go runner | Remote execution, code is uploaded |
| Process text, test a pipeline | Shell runner | Throwaway sandbox, read the exit code |
A sensible order: if it can run locally, do not upload it (Python, JS), and reach for the remote tools only when you need a real compiler. This pairs with how to use the online runners, which covers the sandbox limits - that page explains the boundaries, this one explains how to read the errors.
#Frequently asked questions
#Why did nothing happen when I pressed Run?
Check for compile errors first. With C++, Java and Go, a failed compile means the program never started and the output panel shows the compiler's message. If there is no error and no output either, confirm the program actually prints something - some languages buffer output until the program exits.
#Python says ModuleNotFoundError. Is my code wrong?
Probably not. Pyodide only loads precompiled packages: the standard library is complete, common libraries such as numpy and pandas usually work, and anything requiring a self-compiled C extension does not. If you need a specific package, switch to a remote execution tool.
#What does Segmentation fault mean?
The program touched memory it does not own - usually an uninitialised pointer, an out-of-bounds index, or runaway recursion. Unlike a Python traceback it tells you nothing about which line failed, so add print statements around the suspicious code to narrow it down.
#Exit code 0 but the wrong answer - what went wrong?
That is a logic error. An exit code only says whether the program ended cleanly, not whether the answer is right; a program that computes garbage can exit with 0. Compare expected and actual output with the text diff to see where they diverge.
#Why does the same code work locally but fail online?
Three usual causes: a missing dependency (the online environment installs only part of the ecosystem), missing standard input (you typed it in locally), and environment differences such as working directory, environment variables and line endings. Look for those three in the error before editing code.
Tools used in this guide
Run Python 3 in browser with Pyodide, no install
Open tool →JavaScript RunnerRun JavaScript in the browser locally, console output and async/await support…
Open tool →Java RunnerCompile and run Java with JDK 21, supports stdin and class examples
Open tool →Go RunnerCompile and run Go 1.22, supports stdin, slices and structs
Open tool →C++ RunnerCompile and run C++ with GCC 13
Open tool →Shell RunnerExecute Bash scripts online
Open tool →