Skip to content

Errors & Warnings

What to do about the common ones is in Fix Language Errors.

WhereWhat it shows
resonon run, resonon view console, the REPLThe full text, with the location. A parse error adds the source line and a caret.
VSCode Problems panel and underlinesThe text without the location, underlined where it happened, with the kind’s code beside it.
resonon checkWhat the editor shows, as text, without running the code. See Checking without running.
resonon run --message-format json, resonon check --message-format jsonOne JSON object per line. See Machine-readable output.

A location is path:line:column, or line:column for code that has no file. Some errors have no location, and print their text alone.

Parse error at /home/me/song/src/main.non:1:12: expected neg, pos, not, or primary
|
1 | let x = 1 +;
| ^

resonon run exits with status 1 after an error.

ErrorWhat runs
A parse errorNothing of the file or selection. Every parse error in it is reported, up to 100.
A definition repeated in one file or selectionNothing of it. Every repeat is reported.
Any other errorEverything before the statement that raised it. Its changes stay in the session; nothing is rolled back. See The Error Model.
A warningEverything; the warning is printed as Warning: ….

The code is what VSCode shows beside the message.

CodeTextRaised by
parseParse error at L: …Code that does not fit the grammar, a note literal above MIDI 127 (B9: Invalid note 'B9'), or a definition written inside a function or block.
runtimeRuntime error at L: …A failure with no kind of its own: a bad argument value, a failed operation.
typeType error at L: expected X, got Y, or the annotation’s own sentence: Type error at L: f: x expects a Number, got the String "a"A value of the wrong type for an operator or a condition, or one that does not fit an annotation it crosses.
typeWarning: Type warning at L: expected a Timeline; a Timeline | Section may be a SectionFound only by the editor and resonon check: a value that is one of several types, where only some of them fit. Running fails if the value is one of the others.
conformanceType error at L: Blob implements Shape but has no area()A class that names an interface after implements but does not define what it asks, or defines it differently. The class is not defined. See Interfaces.
signature_driftInternal error: the standard library's signature and the native N disagree: …A standard-library function and the native behind it disagree on an argument’s type. Never your code: report it.
undefined_variableUndefined variable 'x' at LA name that is not defined.
undefined_functionUndefined function 'f' at LA call of a name that is not defined.
undefined_typeunknown type T at LA name in an annotation that is not a type there. The editor and resonon check report it, and running reports it when a value meets the annotation.
undefined_methodUndefined method 'm' for type T at LA method the value’s type does not have.
undefined_propertyUndefined property 'p' for type T at LA field a class instance does not have.
arity_mismatchArity mismatch at L: 'f' expects N arguments, got MToo few or too many arguments. N is a number, a range min-max, or variadic.
division_by_zeroDivision by zero at L/ or % by 0.
index_out_of_boundsIndex out of bounds at L: index I is out of range for length NAn array, tuple or string index past its end.
assertion_failedAssertion failed at L: messageAn assert whose condition is false. Without a message: Assertion failed at L.
borrow_errorBorrow error at L: …A class instance changed while resonon itself still holds it. It should not happen; report it.
private_accessCannot access private 'x' in module 'm' at LA private definition used from outside its module.
read_only_fieldCannot assign 'f' of type T: it is read-only at LAn assignment to a field of a built-in type, such as session.master = x. Resonon sets these fields; code only reads them.
module_not_foundRuntime error at L: Module 'p' not found. Searched: and each folder searchedA use path found in no search path.
duplicate_definitionDuplicate definition at L: fn 'f' repeats the fn at L2. and a line saying what to doA name bound twice in one file or selection — by two definitions, a let and a definition, or a use and anything else.
dspDSP error at L: …A dsp block that does not compile. See DSP Code.
plugin_skippedRuntime error at L: …A plugin that the plugin scan skipped after it crashed. The editor offers to retry it.
version_mismatchRuntime error at L: …Code from a project that needs a newer resonon than the server runs. The editor offers to restart the server.

L is the location.

A warning does not stop the code. resonon run prints it as Warning: …. Each warning has a code:

CodeRaised by
audio_deviceAn audio device that did not open, went away, or cannot do what was asked.
preferencesA preference that is not applied, found when the session starts or by reload_preferences().
track_deletedA deleted track that other tracks output to, send to or sidechain from.
dsp_not_rebuiltA dsp effect or instrument changed so that the instances that run it cannot take the new version.
screen_graphA screen graph that does not build, when no editor shows it.
section_lane_skippedA section lane that plays nothing, because its track is deleted or its target is not found.
unsupported_on_deviceshow_gui() or hide_gui() on a built-in DSP effect, or programs() or set_program() on an effect or instrument that is not VST3.
external_clock_unprimedset_midi_clock_source() while on_cycle callbacks are set. Call prime_cycles() before playback.
midi_port_not_connectedA MIDI track routed to a port that the preferences declare, but whose device is not connected.
render_leaves_outA render that leaves out of master.wav a track routed to hardware outputs.
midi_export_skips_trackA midi_export() that leaves out of the file a track with no pattern.
main_not_calledAn entry file that defines fn main() and does not call it. Nothing calls main() on its own; fn setup() runs when the project opens.
kit_outside_projectA Kit("…") found outside the project. It does not travel with the project.
version_mismatchA project that targets an older resonon than the one that runs it. The code plays.

A warning is located at the place in your code that ran when it was raised: the call that warned, or the statement. A warning raised between two evaluations, for example by an on_cycle callback, has no location, because the code may have changed since it ran.

A screen graph that does not build, and a shader that does not compile, are screen errors. They do not stop the code, and resonon run exits as it would without them. resonon run prints each one as Screen error at L: …. The editor shows it at the line, with the code graph or shader.

Only the visuals window (screen.show()) reports a shader that does not compile as a screen error. resonon run waits for the window to compile before it says how the run went.

The editor checks code as you type, without running it, and runs no code to confirm what it finds.

FoundSeverity
After you evaluate: any errorError
As you type: parse, duplicate_definition, dsp, module_not_found, undefined_*, arity_mismatch, private_access, read_only_fieldError
As you type: type, runtime, division_by_zero, index_out_of_bounds, assertion_failed, borrow_errorWarning

Errors found as you type stay until the code changes; errors from an evaluation clear at your next evaluation.

In Live Mode (online), a duplicate_definition between two top-level bindings in the file is not shown: each selection is evaluated on its own. File Mode (offline) shows them.

resonon check reports what the editor shows in File Mode, from the same analysis. It runs no code and opens no audio or MIDI device. With no file, it checks the project’s src/main.non and src/lib.non, and the modules that they import. resonon check path.non checks one file.

Each error has the severity that the editor gives it. An error found as you type is an error line. A warning found as you type is a warning line, and its text starts with Warning:. A Kit("…") found outside the project is a warning line with the code kit_outside_project and the severity information.

See the shared exit-code contract. Warnings do not change the exit status.

These come from the language server, not from running code:

CodeSeverityWhereMeaning
kit-unportableInformation.nonA Kit("…") whose kit is outside the project and not listed under [local].
kit-missingWarningresonon.tomlA [local] kits entry found nowhere.
kit-outside-projectInformationresonon.tomlA [local] kits entry found only outside the project.
kit-travels-anywayHintresonon.tomlA [local] kits entry for a kit that travels anyway — in the project, a dependency, or the kits resonon ships — so the entry does nothing.
manifest-unknown-keyWarningresonon.tomlA key resonon does not read.
manifest-syntaxErrorresonon.tomlTOML that does not parse.

For send, save, open, check and run, --message-format json prints one JSON object per line on stdout. Each object has the form the server sends to the editor. Its type tells what it is:

typeWhat it is
outputText from print(), in text.
warningA warning, in warning.
errorAn error, in error.
noticeA remark about the machine or the preferences, in text.
renderedA render() or render_master() that wrote its files: the absolute path of its folder, in path.
visual_diagnosticA screen error, in error. kind is graph or shader. ok is true when a shader that the visuals window compiles has no error.
completeThe last line. success is false after an error.

A warning and an error have the same fields:

FieldWhat it is
messageThe full text, as resonon run prints it.
error_typeThe code.
marksWhere the editor marks it. Each mark has a location (file, line, column and end), a severity, the code in error_type, and the text without the location in message.
{"type":"error","id":"…","error":{"message":"Division by zero at /home/me/song/src/main.non:2:13","error_type":"division_by_zero","marks":[{"location":{"line":2,"column":13,"file":"/home/me/song/src/main.non","end":{"line":2,"column":14}},"severity":"error","error_type":"division_by_zero","message":"Division by zero"}]},"timestamp":"12:00:00"}
{"type":"complete","id":"…","success":false,"timestamp":"12:00:00"}

After valid argument parsing, stdout contains only these JSON objects. A refusal before execution writes an error followed by exactly one complete with success: false. Both objects have the same request ID. This includes invalid environment settings, a refused version pin, missing project or entry files, and fatal engine, interpreter or GUI startup failures. Launcher dispatch failures, such as a missing default version or runtime, use the same shape.

Argument usage errors, such as unknown flags or missing option values, retain normal stderr output. They do not produce a message stream.

The exit-code contract is the same as without the option. Startup refusals exit with 2 because execution could not be attempted.

resonon analyze <folder> --format json writes one analysis document, without message-stream objects or a final complete. It does not accept --message-format.