{"record":{"id":"73b0602d8dfc6912","repo":"grafana/k6","slug":"getting-properties-for-element-with-id-s-w","errorCode":null,"errorMessage":"getting properties for element with ID %s: %w","messagePattern":"getting properties for element with ID (.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/browser/common/js_handle.go","lineNumber":177,"sourceCode":"\thandles, err := h.getProperties()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tjsHandles := make(map[string]JSHandleAPI, len(handles))\n\tfor k, v := range handles {\n\t\tjsHandles[k] = v\n\t}\n\n\treturn jsHandles, nil\n}\n\n// getProperties is like GetProperties, but does not panic.\nfunc (h *BaseJSHandle) getProperties() (map[string]jsHandle, error) {\n\tact := runtime.GetProperties(h.remoteObject.ObjectID).WithOwnProperties(true)\n\tresult, _, _, _, err := act.Do(cdp.WithExecutor(h.ctx, h.session)) //nolint:dogsled\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"getting properties for element with ID %s: %w\",\n\t\t\th.remoteObject.ObjectID, err)\n\t}\n\n\tprops := make(map[string]jsHandle, len(result))\n\tfor _, r := range result {\n\t\tif !r.Enumerable {\n\t\t\tcontinue\n\t\t}\n\t\tprops[r.Name] = NewJSHandle(h.ctx, h.session, h.execCtx, h.execCtx.Frame(), r.Value, h.logger)\n\t}\n\n\treturn props, nil\n}\n\n// JSONValue returns a JSON version of this JS handle.\nfunc (h *BaseJSHandle) JSONValue() (string, error) {\n\tremoteObject := h.remoteObject\n\tif remoteObject.ObjectID != \"\" {","sourceCodeStart":159,"sourceCodeEnd":195,"githubUrl":"https://github.com/grafana/k6/blob/01ffac6f245854c1b8adc6a69857c76a15f90022/internal/js/modules/k6/browser/common/js_handle.go#L159-L195","documentation":"Wrap of the CDP Runtime.getProperties command in BaseJSHandle.getProperties: listing the remote object's own properties failed at the protocol level. The %s is the remote object ID. Common causes: the object was already released (handle disposed, or garbage-collected after a heap snapshot/navigation), the session or execution context was destroyed, or the browser target crashed.","triggerScenarios":"Thrown at internal/js/modules/k6/browser/common/js_handle.go:177 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Re-query the handle before calling getProperties if navigation occurred","Call handle.getProperties() before dispose() and before further page activity","Check that the page and browser session are still alive","Avoid holding handles across long-running page interactions that trigger GC"],"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"}