{"record":{"id":"e0262a616b064ed5","repo":"typst/typst","slug":"field-is-not-a-valid-method-for-kind-name","errorCode":null,"errorMessage":"`{field}` is not a valid method for {kind} `{name}`","messagePattern":"`(.+?)` is not a valid method for (.+?) `(.+?)`","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/typst-eval/src/call.rs","lineNumber":282,"sourceCode":"            .read(guard)\n            .or_cannot(format_args!(\"call method `{field}` on content\"))\n            .at(field_span)?\n            .clone()\n    } else if matches!(target, Value::Symbol(_) | Value::Type(_) | Value::Module(_)) {\n        // These types are allowed to use field call syntax on non-methods.\n        target.field(field, guard).at(field_span)?\n    } else if let Value::Func(func) = &target {\n        // Functions can also use field call syntax on non-methods, but not for\n        // settable fields accessed from context.\n        match target.field(field, guard).at(field_span) {\n            Ok(callee_value) => callee_value,\n            Err(err) => {\n                if let Some(element) = func.to_element()\n                    && let Some(field_accessor) = element.settable_field_accessor(field)\n                {\n                    let styles = vm.context.styles().at(field_span)?;\n                    let callee_value = field_accessor(styles);\n                    bail!(disallowed_field_call_error(\n                        callee_value,\n                        access,\n                        field,\n                        target,\n                        in_math\n                    ));\n                } else {\n                    return Err(err);\n                }\n            }\n        }\n    } else {\n        // Otherwise we are not allowed to call the field and produce an error.\n        match target.field(field, guard) {\n            // The field does exist.\n            Ok(callee_value) => {\n                bail!(disallowed_field_call_error(\n                    callee_value,","sourceCodeStart":264,"sourceCodeEnd":300,"githubUrl":"https://github.com/typst/typst/blob/35417aa769ab9d699a60384f91082b09bc6ba421/crates/typst-eval/src/call.rs#L264-L300","documentation":"From eval_field_callee in the evaluator: code used method-call syntax (`target.field(...)`), but `field` resolved to a non-callable field value on the given target kind and name — the field exists as data, not as a method, so it cannot be invoked. The at-fault input is the field name applied to that target.","triggerScenarios":"Thrown at crates/typst-eval/src/call.rs:282 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Access the field without calling it: `target.field` instead of `target.field(...)`","Check the target's documentation for the correct method name","Wrap the retrieved value if you meant to call a function stored in the field"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"35417aa769ab9d699a60384f91082b09bc6ba421","analyzedAt":"2026-08-17T21:03:48.984Z","contentChangedAt":"2026-08-17T21:03:48.984Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}