{"record":{"id":"e7706afabe3657ac","repo":"JuliusBrussee/caveman","slug":"browser-function-returned-no-result-object","errorCode":null,"errorMessage":"browser function returned no result object","messagePattern":"browser function returned no result object","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"browse/cdp.go","lineNumber":418,"sourceCode":"\tvar exception *runtime.ExceptionDetails\n\tif err := chromedp.Run(ctx, chromedp.ActionFunc(func(actionCtx context.Context) error {\n\t\tobj, err := dom.ResolveNode().WithBackendNodeID(cdp.BackendNodeID(target.BackendDOMNodeID)).Do(actionCtx)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif obj == nil {\n\t\t\treturn errors.New(\"resolve node returned no object\")\n\t\t}\n\t\tres, exception, err = runtime.CallFunctionOn(fn).WithObjectID(obj.ObjectID).Do(actionCtx)\n\t\treturn err\n\t})); err != nil {\n\t\treturn nil, err\n\t}\n\tif exception != nil {\n\t\treturn nil, errors.New(\"browser function threw\")\n\t}\n\tif res == nil {\n\t\treturn nil, errors.New(\"browser function returned no result object\")\n\t}\n\treturn res, nil\n}\n\nfunc jsString(s string) string {\n\tb, _ := json.Marshal(s)\n\treturn string(b)\n}\n\nfunc DefaultUserDataDir(home string) string {\n\tif home == \"\" {\n\t\tif h, err := os.UserHomeDir(); err == nil {\n\t\t\thome = filepath.Join(h, \".caveman\")\n\t\t}\n\t}\n\tif home == \"\" {\n\t\treturn \"\"\n\t}","sourceCodeStart":400,"sourceCodeEnd":436,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/3ee70a102609e550bd2e68004bf5990a9341c851/browse/cdp.go#L400-L436","documentation":"Thrown in callOnNodeRaw when Runtime.callFunctionOn returns neither an exception nor a result object (res == nil). This is an unexpected protocol response: a successful call should always return a RemoteObject, so nil indicates the browser did not send the expected payload.","triggerScenarios":"CDP responds with an empty/missing 'result' field: node destroyed between resolveNode and callFunctionOn returning nothing, protocol mismatch between chromedp and the browser version, or the call returned an undefined-by-protocol shape.","commonSituations":"Running against an older/newer Chromium than the chromedp protocol expects; flaky responses during page teardown; browser under crash/OOM pressure dropping payloads.","solutions":["Update chromedp and the browser to matched, recent versions.","Retry the call; transient protocol gaps during teardown often resolve.","Re-snapshot to obtain a fresh node handle before retrying.","If persistent, add logging of the raw CDP response and file an issue with browser version."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"var out *Result\nerr := retry(3, backoff, func() error {\n    var e error\n    out, e = sess.CallOnNode(target, fn)\n    if e != nil && strings.Contains(e.Error(), \"returned no result object\") {\n        return e // retryable protocol gap\n    }\n    return stop(e)\n})\nreturn err","preventionTips":["Keep chromedp and the browser build version-matched and updated.","Avoid calling into nodes while the page/iframe is tearing down.","Monitor browser health (crash/OOM) in long sessions.","Re-snapshot rather than reusing very old node handles."],"tags":["cdp","protocol","empty-response","browser"],"backgroundTag":"unexpected-response-shape","analyzedSha":"3ee70a102609e550bd2e68004bf5990a9341c851","analyzedAt":"2026-09-20T15:53:39.229Z","contentChangedAt":"2026-09-20T15:53:39.229Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}