{"record":{"id":"77fd3190d77baf28","repo":"grafana/k6","slug":"unknown-binarytype-s-the-supported-ones-are-blo","errorCode":null,"errorMessage":"unknown binaryType %s, the supported ones are \"blob\" and \"arraybuffer\"","messagePattern":"unknown binaryType (.+?), the supported ones are \"blob\" and \"arraybuffer\"","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/websockets/websockets.go","lineNumber":230,"sourceCode":"\t\t\treturn rt.ToValue((uint)(w.readyState))\n\t\t}), nil, sobek.FLAG_FALSE, sobek.FLAG_TRUE))\n\tmust(rt, w.obj.DefineAccessorProperty(\n\t\t\"bufferedAmount\", rt.ToValue(func() sobek.Value { return rt.ToValue(w.bufferedAmount) }), nil,\n\t\tsobek.FLAG_FALSE, sobek.FLAG_TRUE))\n\tmust(rt, w.obj.DefineAccessorProperty(\"extensions\",\n\t\trt.ToValue(func() sobek.Value { return rt.ToValue(w.extensions) }), nil, sobek.FLAG_FALSE, sobek.FLAG_TRUE))\n\tmust(rt, w.obj.DefineAccessorProperty(\n\t\t\"protocol\", rt.ToValue(func() sobek.Value { return rt.ToValue(w.protocol) }), nil, sobek.FLAG_FALSE, sobek.FLAG_TRUE))\n\tmust(rt, w.obj.DefineAccessorProperty(\n\t\t\"binaryType\", rt.ToValue(func() sobek.Value {\n\t\t\treturn rt.ToValue(w.binaryType)\n\t\t}), rt.ToValue(func(s string) error {\n\t\t\tswitch s {\n\t\t\tcase blobBinaryType, arraybufferBinaryType:\n\t\t\t\tw.binaryType = s\n\t\t\t\treturn nil\n\t\t\tdefault:\n\t\t\t\treturn fmt.Errorf(`unknown binaryType %s, the supported ones are \"blob\" and \"arraybuffer\"`, s)\n\t\t\t}\n\t\t}), sobek.FLAG_FALSE, sobek.FLAG_TRUE))\n\n\tsetOn := func(property string, el *eventListener) {\n\t\tif el == nil {\n\t\t\t// this is generally should not happen, but we're being defensive\n\t\t\tcommon.Throw(rt, fmt.Errorf(\"not supported on-handler '%s'\", property))\n\t\t}\n\n\t\tmust(rt, w.obj.DefineAccessorProperty(\n\t\t\tproperty, rt.ToValue(func() sobek.Value {\n\t\t\t\treturn rt.ToValue(el.getOn)\n\t\t\t}), rt.ToValue(func(call sobek.FunctionCall) sobek.Value {\n\t\t\t\targ := call.Argument(0)\n\n\t\t\t\t// it's possible to unset handlers by setting them to null\n\t\t\t\tif common.IsNullish(arg) {\n\t\t\t\t\tel.setOn(nil)","sourceCodeStart":212,"sourceCodeEnd":248,"githubUrl":"https://github.com/grafana/k6/blob/165bb3c1a492b7a4823907fe1e93a30645794737/internal/js/modules/k6/websockets/websockets.go#L212-L248","documentation":"A default-branch guard in the WebSocket message handler: an incoming binary frame arrived, but the socket's binaryType property holds a value other than the two supported strings \"blob\" and \"arraybuffer\". Because binaryType is defined as an accessor that validates on assignment, reaching this default case normally means the internal state was mutated unexpectedly rather than through the public property setter.","triggerScenarios":"Thrown at internal/js/modules/k6/websockets/websockets.go:219 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set ws.binaryType explicitly to \"arraybuffer\" or \"blob\" (the default) before receiving binary messages","Do not attempt to override or delete the binaryType property on the WebSocket object","Update k6 to a recent version in case earlier builds allowed invalid binaryType values"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"165bb3c1a492b7a4823907fe1e93a30645794737","analyzedAt":"2026-08-18T03:05:52.393Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}