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.
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.
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.
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_effectshow_gui() or hide_gui() on a built-in DSP effect, or programs() or set_program() on an effect 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.
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.

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_accessError
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.

The exit status is 0 when there is no error, and 1 when there is one or more. Warnings do not change it. A usage error exits with 2.

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.

resonon run --message-format json and resonon check --message-format json print 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.
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"}

The exit status is the same as without the option.