{"record":{"id":"4a3fbf8c8bc37ffb","repo":"grafana/k6","slug":"converting-argument-q-in-execution-context-id-d","errorCode":null,"errorMessage":"converting argument %q in execution context ID %d and frame ID %v: %w","messagePattern":"converting argument %q in execution context ID (.+?) and frame ID (.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/browser/common/execution_context.go","lineNumber":191,"sourceCode":"\t\tDo(context.Context) (*runtime.RemoteObject, *runtime.ExceptionDetails, error)\n\t}\n\n\tif !opts.forceCallable {\n\t\tif !hasSourceURL(js) {\n\t\t\tjs += \"\\n\" + suffix\n\t\t}\n\n\t\taction = runtime.Evaluate(js).\n\t\t\tWithContextID(e.id).\n\t\t\tWithReturnByValue(opts.returnByValue).\n\t\t\tWithAwaitPromise(true).\n\t\t\tWithUserGesture(true)\n\t} else {\n\t\tvar arguments []*runtime.CallArgument\n\t\tfor _, arg := range args {\n\t\t\tresult, err := convertArgument(apiCtx, e, arg)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"converting argument %q \"+\n\t\t\t\t\t\"in execution context ID %d and frame ID %v: %w\",\n\t\t\t\t\targ, e.id, e.Frame().ID(), err)\n\t\t\t}\n\t\t\targuments = append(arguments, result)\n\t\t}\n\n\t\tjs += \"\\n\" + suffix + \"\\n\"\n\t\taction = runtime.CallFunctionOn(js).\n\t\t\tWithArguments(arguments).\n\t\t\tWithExecutionContextID(e.id).\n\t\t\tWithReturnByValue(opts.returnByValue).\n\t\t\tWithAwaitPromise(true).\n\t\t\tWithUserGesture(true)\n\t}\n\n\tvar (\n\t\tremoteObject     *runtime.RemoteObject\n\t\texceptionDetails *runtime.ExceptionDetails","sourceCodeStart":173,"sourceCodeEnd":209,"githubUrl":"https://github.com/grafana/k6/blob/01ffac6f245854c1b8adc6a69857c76a15f90022/internal/js/modules/k6/browser/common/execution_context.go#L173-L209","documentation":"Returned by ExecutionContext.eval when converting a Go argument to a CDP CallArgument fails before calling the injected function. The failing argument, execution context ID and frame ID are included. This is argument marshalling failure: the argument type is not serializable (e.g. unsupported Go value passed through from the script).","triggerScenarios":"Thrown at internal/js/modules/k6/browser/common/execution_context.go:191 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass only serializable arguments: primitives, arrays/maps of primitives, or handles","Convert custom objects to plain JS-serializable structures before passing","Avoid passing functions, channels, or other non-exportable Go values"],"exampleFix":null,"handlingStrategy":"validation","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"}