{"record":{"id":"7be4fe29b2e907a5","repo":"grafana/k6","slug":"options-must-be-an-object","errorCode":null,"errorMessage":"[options] must be an object","messagePattern":"\\[options\\] must be an object","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/websockets/blob.go","lineNumber":43,"sourceCode":"func (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}\n\n\tobj := rt.NewObject()\n\tmust(rt, obj.DefineAccessorProperty(\"size\", rt.ToValue(func() sobek.Value {\n\t\treturn rt.ToValue(b.data.Len())\n\t}), nil, sobek.FLAG_FALSE, sobek.FLAG_TRUE))\n\tmust(rt, obj.DefineAccessorProperty(\"type\", rt.ToValue(func() sobek.Value {\n\t\treturn rt.ToValue(b.typ)\n\t}), nil, sobek.FLAG_FALSE, sobek.FLAG_TRUE))\n\n\tmust(rt, obj.Set(\"arrayBuffer\", func(_ sobek.FunctionCall) sobek.Value {\n\t\tpromise, resolve, _ := rt.NewPromise()","sourceCodeStart":25,"sourceCodeEnd":61,"githubUrl":"https://github.com/grafana/k6/blob/93accf6570dcd306ca5e99cc44c393ee3797761b/internal/js/modules/k6/websockets/blob.go#L25-L61","documentation":"Error \"[options] must be an object\" thrown in grafana/k6.","triggerScenarios":"Thrown at internal/js/modules/k6/websockets/blob.go:43 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"93accf6570dcd306ca5e99cc44c393ee3797761b","analyzedAt":"2026-08-15T21:23:27.118Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}