Reading Errors From Online Code Runners (6 Languages)

2026-11-056 min readOnline Runners6 tools covered

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.

Key takeaways
  • 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.

LayerWhat you seeWhat to do
CompileNo program output at all, just compiler messagesFix syntax, ignore logic for now
RuntimeOutput stops partway, or exit code is non-zeroRead the traceback or exception type
EnvironmentMissing package, no stdin, timeout, sandbox limitChange the approach or the tool, not the code
Key point

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 numpy usually work. A ModuleNotFoundError is 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.

CPP
// 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.

Tip

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 curl against 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 / export raise a hint, because ESM syntax cannot appear inside a function body.
  • A top-level return does 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 needToolKey difference
Run a Python script or check an algorithmPython runnerLocal, nothing uploaded, no stdin
Verify a piece of JS logicJavaScript runnerLocal execution, module syntax misreports
Confirm code compiles for a courseC++ runnerGCC 13.2.0, stdin supported
Practise Java classes and collectionsJava runnerRemote compile, fix compile errors first
Check standard library or concurrency usageGo runnerRemote execution, code is uploaded
Process text, test a pipelineShell runnerThrowaway 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

Related guides