{"record":{"id":"8b3c4828da649aae","repo":"grafana/k6","slug":"s","errorCode":null,"errorMessage":"%s","messagePattern":"%s","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/browser/common/execution_context.go","lineNumber":224,"sourceCode":"\n\tvar (\n\t\tremoteObject     *runtime.RemoteObject\n\t\texceptionDetails *runtime.ExceptionDetails\n\t\terr              error\n\t)\n\tif remoteObject, exceptionDetails, err = action.Do(cdp.WithExecutor(apiCtx, e.session)); err != nil {\n\t\tvar cdpe *cdproto.Error\n\t\tif errors.As(err, &cdpe) && cdpe.Code == devToolsServerErrorCode {\n\t\t\t// By creating a new error instead of reusing it, we're removing the\n\t\t\t// chromium specific error code.\n\t\t\treturn nil, errors.New(cdpe.Message)\n\t\t}\n\n\t\te.logger.Debugf(\"ExecutionContext:eval\", \"Unexpected DevTools server error: %v\", err)\n\t\treturn nil, err\n\t}\n\tif exceptionDetails != nil {\n\t\treturn nil, fmt.Errorf(\"%s\", parseExceptionDetails(exceptionDetails))\n\t}\n\tvar res any\n\tif remoteObject == nil {\n\t\te.logger.Debugf(\n\t\t\t\"ExecutionContext:eval\",\n\t\t\t\"sid:%s stid:%s fid:%s ectxid:%d furl:%q remoteObject is nil\",\n\t\t\te.sid, e.stid, e.fid, e.id, e.furl)\n\t\treturn res, nil\n\t}\n\n\tif opts.returnByValue {\n\t\tres, err = valueFromRemoteObject(apiCtx, remoteObject)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\n\t\t\t\t\"extracting value from remote object with ID %s: %w\",\n\t\t\t\tremoteObject.ObjectID, err)\n\t\t}\n\t} else if remoteObject.ObjectID != \"\" {","sourceCodeStart":206,"sourceCodeEnd":242,"githubUrl":"https://github.com/grafana/k6/blob/01ffac6f245854c1b8adc6a69857c76a15f90022/internal/js/modules/k6/browser/common/execution_context.go#L206-L242","documentation":"Returned by ExecutionContext.eval when the page-side evaluation completed with ExceptionDetails — i.e. the evaluated JS threw. parseExceptionDetails renders the JS exception (message, stack) into the error text. The JS code itself failed at runtime; this is not a transport or timeout error.","triggerScenarios":"Thrown at internal/js/modules/k6/browser/common/execution_context.go:224 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the JS exception reported in the error text (see message/stack)","Guard against nulls/undefined in evaluated page functions","Wrap risky page code in try/catch inside the evaluated function to control the message"],"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"}