Skip to content

Reference

Error code reference

Every diagnostic the Super.js compiler can emit. Codes are permanent — never renumbered or reused. SJS-P are parser errors, SJS-E type errors, SJS-W warnings (promoted to errors under --strict), and SJS-L lint rules (off under --loose).

43 codes, generated from the @superjs/diagnostics registry.

Parser

CodeSeverityMessageStage
SJS-P001errorUnexpected tokenStage 1
SJS-P002errorUnexpected end of fileStage 1
SJS-P003errorInvalid syntax in type annotationStage 1
SJS-P004errorInvalid sum type declarationStage 1
SJS-P005errorInvalid match expressionStage 1
SJS-P099errorToo many parse errors; recovery abandonedStage 1

Null safety

CodeSeverityMessageStage
SJS-E001errorNull or undefined assigned to non-nullable type `{type}`Stage 0
SJS-E003errorProperty access on possibly-null valueStage 0
SJS-E011errorNon-null assertion `!` is not allowed; use narrowingStage 1

Type checking

CodeSeverityMessageStage
SJS-E002errorType mismatch: expected `{expected}`, found `{found}`Stage 0
SJS-E004error`any` is not a valid type in SJS; use `dynamic`Stage 1
SJS-E005errorIntersection type `A & B` is not allowed; use interface extensionStage 1
SJS-E006errorMapped type is not allowed in SJSStage 1
SJS-E008errorConditional type `T extends U ? A : B` is not allowedStage 1
SJS-E009error`infer` keyword is not allowed in SJSStage 1
SJS-E010errorTypeScript `enum` is not allowed; use sum typesStage 1
SJS-E012error`namespace` is not allowed; use ES modulesStage 1
SJS-E020errorAmbiguous variant constructor `{variant}` — multiple sum types declare it; annotate the expected typeStage 1
SJS-W006warningExcess property `{name}` on a fresh object literal assigned to a typed positionStage 1

Match expressions

CodeSeverityMessageStage
SJS-E007errorMatch expression is not exhaustive: missing variant `{variant}`Stage 0
SJS-W003warningUnreachable `match` arm — earlier arm already covers this variantStage 1

Control flow

CodeSeverityMessageStage
SJS-E013error`with` statement not allowed (SJS is always strict mode)Stage 1
SJS-W008warningImplicit switch fallthrough between non-empty case clausesStage 1
SJS-W009warningUnreachable code following a terminator statementStage 1

Access modifiers

CodeSeverityMessageStage
SJS-E014errorMember `{member}` is not accessible from this scopeStage 1
SJS-E015errorCannot narrow an access modifier on an overriding memberStage 1
SJS-W005warningExplicit `public` modifier is redundant — members are public by defaultStage 1

Classes

CodeSeverityMessageStage
SJS-E016errorCannot instantiate an abstract class directly with `new`Stage 1

Modules

CodeSeverityMessageStage
SJS-E017errorCircular import detected — module graph contains a cycleStage 1

Async / await

CodeSeverityMessageStage
SJS-E018errorTop-level `await` used outside an ES module contextStage 1

JSX

CodeSeverityMessageStage
SJS-E019errorUnknown JSX element type `{name}`Stage 2
SJS-W007warningMissing `key` prop on JSX element in a list or iterator contextStage 2

Dynamic

CodeSeverityMessageStage
SJS-W001warningImplicit `dynamic` — unannotated position in `--strict` modeStage 0
SJS-W002warning`dynamic` value assigned to a typed position without a narrowing checkStage 1

Keywords

CodeSeverityMessageStage
SJS-W004warningReserved or future SJS keyword `{name}` used as an identifierStage 1

Try / catch

CodeSeverityMessageStage
SJS-W010warning`catch` binding not typed as `Error` or `unknown`Stage 1

Security

CodeSeverityMessageStage
SJS-W012warningBiDi control character in source fileStage 1
SJS-L011errorBiDi control character rejectedStage 1

Lint

CodeSeverityMessageStage
SJS-L001warningPrefer `const` — `let` binding `{name}` is never reassignedStage 3
SJS-L002warningPrefer `let` or `const` over `var`Stage 3
SJS-L003warningUse `===` / `!==` — `==` / `!=` performs type coercionStage 3
SJS-L004warningPrefer `for…of` over `for…in` for array and iterable iterationStage 3
SJS-L005warning`debugger` statement found in committed codeStage 3