Skip to main content

Error codes

Error codeError description
M0001Parsing errors
M0003Module tried to import itself
M0009File not found for import
M0010Imported package was not defined
M0014Non-static expression in library or module
M0029Unbound type
M0030Type field does not exist in type
M0031Shared function has non-shared parameter type
M0032Shared function has non-shared return type
M0033Async has non-shared content type
M0036Invalid return type for shared query function
M0038Misplaced await
M0045Wrong number of type arguments
M0047Send capability required
M0050Literal does not have expected type
M0055Cannot infer type of forward variable
M0057Unbound variable
M0060Operator is not defined for operand types
M0064Misplaced '!' without enclosing do block
M0070Expected object type
M0072Field does not exist in type
M0073Expected mutable assignment target
M0082Expected iterable type
M0088Expected async type
M0089Redundant ignore
M0090Actor reference must have an actor type
M0096Expression can't produce expected type
M0097Expected function type
M0098Cannot instantiate function type
M0112Tuple pattern cannot consume type
M0116Variant pattern cannot consume type
M0126Shared function cannot be private
M0137A type or class was declared that explicitly or implicitly references an outer type parameter.
M0139Inner actor classes are not supported
M0141Forbidden declaration in program
M0145Pattern does not cover value
M0149An immutable record field (declared without var) was supplied where a mutable record field (specified with var), was expected.
M0150A mutable record field (declared with var) was supplied where an immutable record field (specified without var) was expected.
M0151A object literal is missing some fields.
M0153An imported Candid file (.did) mentions types that cannot be represented in Motoko.
M0154Deprecation annotation
M0155Inferred type Nat for subtraction
M0156A parameterized type definition, or set of type definitions, is too complicated for Motoko to accept.
M0157A type definition, or set of type definitions, is ill-defined.
M0158A public class was declared without providing it with a name.
M0194An identifier was defined without referencing it later.
M0195A function that demands elevated (system) capabilities was called without manifestly passing the capability.
M0197A function that requires (system) capabilities was called in a context that does not provide them.
M0198A field identifier was specified in an object pattern without referencing this identifier later.
Logo