JuliusBrussee/caveman · warning

browser function returned no result object

Error message

browser function returned no result object

What it means

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.

Solutions

  1. Update chromedp and the browser to matched, recent versions.
  2. Retry the call; transient protocol gaps during teardown often resolve.
  3. Re-snapshot to obtain a fresh node handle before retrying.
  4. If persistent, add logging of the raw CDP response and file an issue with browser version.
Defensive patterns

Strategy: retry

Try / catch

var out *Result
err := retry(3, backoff, func() error {
    var e error
    out, e = sess.CallOnNode(target, fn)
    if e != nil && strings.Contains(e.Error(), "returned no result object") {
        return e // retryable protocol gap
    }
    return stop(e)
})
return err

Prevention

When it happens

Trigger: 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.

Common situations: Running against an older/newer Chromium than the chromedp protocol expects; flaky responses during page teardown; browser under crash/OOM pressure dropping payloads.

Related errors


AI-assisted analysis of JuliusBrussee/caveman@3ee70a1026 (2026-09-20). Data as JSON: /api/errors/e7706afabe3657ac. Report an issue: GitHub.

Appendix: source

Thrown at browse/cdp.go:418

	var exception *runtime.ExceptionDetails
	if err := chromedp.Run(ctx, chromedp.ActionFunc(func(actionCtx context.Context) error {
		obj, err := dom.ResolveNode().WithBackendNodeID(cdp.BackendNodeID(target.BackendDOMNodeID)).Do(actionCtx)
		if err != nil {
			return err
		}
		if obj == nil {
			return errors.New("resolve node returned no object")
		}
		res, exception, err = runtime.CallFunctionOn(fn).WithObjectID(obj.ObjectID).Do(actionCtx)
		return err
	})); err != nil {
		return nil, err
	}
	if exception != nil {
		return nil, errors.New("browser function threw")
	}
	if res == nil {
		return nil, errors.New("browser function returned no result object")
	}
	return res, nil
}

func jsString(s string) string {
	b, _ := json.Marshal(s)
	return string(b)
}

func DefaultUserDataDir(home string) string {
	if home == "" {
		if h, err := os.UserHomeDir(); err == nil {
			home = filepath.Join(h, ".caveman")
		}
	}
	if home == "" {
		return ""
	}

View on GitHub (pinned to 3ee70a1026)