sipeed/picoclaw · error
type error at line , column for field : expected but got \n
Error message
%s type error at line %d, column %d for field %q: expected %s but got %s\n%s
What it means
wrapJSONError branch for json.UnmarshalTypeError with a known field name and preview: a value has the right JSON location but the wrong type (e.g. a string where a number is expected). Names the field, expected type, actual value, and shows the offending line preview.
Solutions
- Change the field's value to the expected type shown in the message (e.g. quote or unquote it)
- Check the documented schema for that field's type
- Watch for JSON numbers written as strings ("8080" vs 8080)
Defensive patterns
Strategy: type-guard
When it happens
Trigger: Thrown at pkg/config/diagnostics.go:86 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of sipeed/picoclaw@49183d7e8d (2026-08-15).
Data as JSON: /api/errors/50f84e19e484b4f8.
Report an issue: GitHub.
Appendix: source
Thrown at pkg/config/diagnostics.go:86
preview := diagnosticPreviewForOffset(data, e.Offset)
if preview != "" {
return fmt.Errorf(
"%s syntax error at line %d, column %d: %w\n%s",
label,
line,
column,
err,
preview,
)
}
return fmt.Errorf("%s syntax error at line %d, column %d: %w", label, line, column, err)
case *json.UnmarshalTypeError:
line, column := lineAndColumnForOffset(data, e.Offset)
preview := diagnosticPreviewForOffset(data, e.Offset)
field := strings.TrimSpace(e.Field)
if field != "" {
if preview != "" {
return fmt.Errorf(
"%s type error at line %d, column %d for field %q: expected %s but got %s\n%s",
label,
line,
column,
field,
e.Type.String(),
e.Value,
preview,
)
}
return fmt.Errorf(
"%s type error at line %d, column %d for field %q: expected %s but got %s",
label,
line,
column,
field,
e.Type.String(),
e.Value,View on GitHub (pinned to 49183d7e8d)