{"record":{"id":"11ee6115435be432","repo":"tomnomnom/gron","slug":"json-internal-error","errorCode":null,"errorMessage":"JSON internal error","messagePattern":"JSON internal error","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"statements.go","lineNumber":214,"sourceCode":"\tv = a[1]\n\ta, ok = a[0].([]interface{})\n\tif !ok {\n\t\tgoto out\n\t}\n\n\t// We'll append one initial token, then 3 tokens for each element of a,\n\t// then 3 closing tokens, that's alltogether 3*len(a)+4.\n\ts = make(statement, 0, 3*len(a)+4)\n\ts = append(s, token{\"json\", typBare})\n\tfor _, e := range a {\n\t\ts = append(s, token{\"[\", typLBrace})\n\t\tswitch e := e.(type) {\n\t\tcase string:\n\t\t\ts = append(s, token{quoteString(e), typQuotedKey})\n\t\tcase float64:\n\t\t\tnbuf, err = json.Marshal(e)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, errors.Wrap(err, \"JSON internal error\")\n\t\t\t}\n\t\t\tnstr = string(nbuf)\n\t\t\ts = append(s, token{nstr, typNumericKey})\n\t\tdefault:\n\t\t\tok = false\n\t\t\tgoto out\n\t\t}\n\t\ts = append(s, token{\"]\", typRBrace})\n\t}\n\n\ts = append(s, token{\"=\", typEquals})\n\n\tswitch v := v.(type) {\n\tcase bool:\n\t\tif v {\n\t\t\tt = typTrue\n\t\t} else {\n\t\t\tt = typFalse","sourceCodeStart":196,"sourceCodeEnd":232,"githubUrl":"https://github.com/tomnomnom/gron/blob/88a6234ea2d0c487090988182ad9a7cdf6def924/statements.go#L196-L232","documentation":"While converting a decoded JSON document into Gron statement tokens, json.Marshal failed on a float64 array element (or on the statement's value) — types that JSON encoding must always support. The wrap message marks this as an internal invariant violation, not bad user input, since the value originated from successful json.Unmarshal decoding.","triggerScenarios":"Thrown at statements.go:214 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Investigate the wrapped json.Marshal error; a failure here indicates corrupted or impossible in-memory state","Verify the input decoding path produces only standard JSON-encodable values (float64, string, bool, nil, arrays, maps)"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"88a6234ea2d0c487090988182ad9a7cdf6def924","analyzedAt":"2026-09-06T11:35:31.658Z","contentChangedAt":"2026-09-06T11:35:31.658Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}