{"record":{"id":"58937563804bf222","repo":"grafana/k6","slug":"extracting-value-from-remote-object-with-id-s-w","errorCode":null,"errorMessage":"extracting value from remote object with ID %s: %w","messagePattern":"extracting value from remote object with ID (.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/browser/common/execution_context.go","lineNumber":238,"sourceCode":"\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 != \"\" {\n\t\t// Note: we don't use the passed in apiCtx here as it could be tied to a timeout\n\t\tres = NewJSHandle(e.ctx, e.session, e, e.frame, remoteObject, e.logger)\n\t}\n\n\treturn res, nil\n}\n\n// Based on: https://github.com/microsoft/playwright/blob/master/src/server/injected/injectedScript.ts\n//\n//go:embed js/injected_script.js\nvar injectedScriptSource string\n\n//nolint:gochecknoglobals\nvar injectedScriptSourceWithSourceURL = `(() => {` + injectedScriptSource + `; return new InjectedScript();})()` +","sourceCodeStart":220,"sourceCodeEnd":256,"githubUrl":"https://github.com/grafana/k6/blob/01ffac6f245854c1b8adc6a69857c76a15f90022/internal/js/modules/k6/browser/common/execution_context.go#L220-L256","documentation":"Returned by ExecutionContext.eval (returnByValue path) when valueFromRemoteObject fails to deserialize the remote object's value into a Go any — the object's CDP type/serialization is unsupported or the session died mid-read. Object ID is included for correlation with debug logs.","triggerScenarios":"Thrown at internal/js/modules/k6/browser/common/execution_context.go:238 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry the evaluation if the failure coincided with navigation","Return handles instead of values (returnByValue:false) for complex objects","Check debug logs with the object ID for the underlying cause"],"exampleFix":null,"handlingStrategy":"retry","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"}