{"record":{"id":"10217a2d8d9eff99","repo":"grafana/k6","slug":"failed-to-process-blobparts-w","errorCode":null,"errorMessage":"failed to process [blobParts]: %w","messagePattern":"failed to process \\[blobParts\\]: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/websockets/blob.go","lineNumber":32,"sourceCode":")\n\ntype blob struct {\n\ttyp  string\n\tdata *bytes.Buffer\n}\n\nfunc (b *blob) text() string {\n\treturn b.data.String()\n}\n\nfunc (r *WebSocketsAPI) blob(call sobek.ConstructorCall) *sobek.Object {\n\trt := r.vu.Runtime()\n\n\tb := &blob{data: new(bytes.Buffer)}\n\tvar blobParts []any\n\tif len(call.Arguments) > 0 {\n\t\tif err := rt.ExportTo(call.Arguments[0], &blobParts); err != nil {\n\t\t\tcommon.Throw(rt, fmt.Errorf(\"failed to process [blobParts]: %w\", err))\n\t\t}\n\t}\n\n\tif len(blobParts) > 0 {\n\t\tr.fillData(b, blobParts, call)\n\t}\n\n\tif len(call.Arguments) > 1 && !sobek.IsUndefined(call.Arguments[1]) {\n\t\topts := call.Arguments[1]\n\t\tif !isObject(opts) {\n\t\t\tcommon.Throw(rt, errors.New(\"[options] must be an object\"))\n\t\t}\n\n\t\ttypeOpt := opts.ToObject(rt).Get(\"type\")\n\t\tif !sobek.IsUndefined(typeOpt) {\n\t\t\tb.typ = typeOpt.String()\n\t\t}\n\t}","sourceCodeStart":14,"sourceCodeEnd":50,"githubUrl":"https://github.com/grafana/k6/blob/01ffac6f245854c1b8adc6a69857c76a15f90022/internal/js/modules/k6/websockets/blob.go#L14-L50","documentation":"Thrown by the Blob constructor when its first argument (blobParts) cannot be exported to a Go []any — sobek's ExportTo failed, meaning the value is not an array-like iterable of blob parts (e.g. a non-iterable object or a symbol). Thrown immediately via common.Throw, aborting construction.","triggerScenarios":"Thrown at internal/js/modules/k6/websockets/blob.go:32 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass an array of parts: new Blob(['text', arrayBuffer, anotherBlob])","Pass no arguments or an empty array if an empty Blob is intended"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"01ffac6f245854c1b8adc6a69857c76a15f90022","analyzedAt":"2026-08-18T03:05:52.393Z","contentChangedAt":"2026-08-18T03:05:52.393Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}