sipeed/picoclaw · error
type error at line , column : expected but got
Error message
%s type error at line %d, column %d: expected %s but got %s
What it means
Final json.UnmarshalTypeError variant in wrapJSONError: a wrong-typed value was found at line/column with no field name and no extractable preview. The generic fallback of the type-error handling, still reporting expected vs actual types.
Solutions
- Locate the reported line/column and correct the value's type
- Diff the file against a known-good config or backup
- Reformat the JSON to make field attribution clearer, then reload
Defensive patterns
Strategy: type-guard
When it happens
Trigger: Thrown at pkg/config/diagnostics.go:118 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/75b64ae13831e37e.
Report an issue: GitHub.
Appendix: source
Thrown at pkg/config/diagnostics.go:118
line,
column,
field,
e.Type.String(),
e.Value,
)
}
if preview != "" {
return fmt.Errorf(
"%s type error at line %d, column %d: expected %s but got %s\n%s",
label,
line,
column,
e.Type.String(),
e.Value,
preview,
)
}
return fmt.Errorf(
"%s type error at line %d, column %d: expected %s but got %s",
label,
line,
column,
e.Type.String(),
e.Value,
)
default:
return fmt.Errorf("failed to parse %s: %w", label, err)
}
}
func splitDiagnosticError(message string) (string, string) {
if idx := strings.IndexByte(message, '\n'); idx >= 0 {
return message[:idx], message[idx+1:]
}
return message, ""
}View on GitHub (pinned to 49183d7e8d)