{"record":{"id":"89a2191f2addbb3b","repo":"dotnet/runtime","slug":"could-not-find-any-object-with-id-objectid","errorCode":null,"errorMessage":"Could not find any object with id ${objectId}","messagePattern":"Could not find any object with id (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/mono/browser/runtime/debug.ts","lineNumber":285,"sourceCode":"            subtype: \"array\",\n            className: \"Array\",\n            description: `Array(${fn_res.length})`,\n            objectId: fn_res_id\n        };\n    }\n    if (fn_res.value !== undefined || fn_res.subtype !== undefined) {\n        return fn_res;\n    }\n\n    if (fn_res == proxy)\n        return { type: \"object\", className: \"Object\", description: \"Object\", objectId: objId };\n    const fn_res_id = _cache_call_function_res(fn_res);\n    return { type: \"object\", className: \"Object\", description: \"Object\", objectId: fn_res_id };\n}\n\nfunction _get_cfo_res_details (objectId: string, args: any): ValueAsJsonString {\n    if (!(objectId in _call_function_res_cache))\n        throw new Error(`Could not find any object with id ${objectId}`);\n\n    const real_obj = _call_function_res_cache[objectId];\n\n    const descriptors = Object.getOwnPropertyDescriptors(real_obj);\n    if (args.accessorPropertiesOnly) {\n        Object.keys(descriptors).forEach(k => {\n            if (descriptors[k].get === undefined)\n                Reflect.deleteProperty(descriptors, k);\n        });\n    }\n\n    const res_details: any[] = [];\n    Object.keys(descriptors).forEach(k => {\n        let new_obj;\n        const prop_desc = descriptors[k];\n        if (typeof prop_desc.value == \"object\") {\n            // convert `{value: { type='object', ... }}`\n            // to      `{ name: 'foo', value: { type='object', ... }}","sourceCodeStart":267,"sourceCodeEnd":303,"githubUrl":"https://github.com/dotnet/runtime/blob/60108ba66eb7d1d12f595480091b4ad80a24b172/src/mono/browser/runtime/debug.ts#L267-L303","documentation":"Thrown by `_get_cfo_res_details` when asked to describe an object id that is not in `_call_function_res_cache`. This is the lookup path used by the inspector to enumerate properties of a previously returned call-function-on result; an unknown id means the cached object is gone.","triggerScenarios":"Calling the internal details helper (debug.ts:283) with an `objectId` not present in `_call_function_res_cache`. Triggered when the inspector asks for properties of an object whose cache entry was cleared by `mono_wasm_runtime_ready`, or that was issued by a different runtime instance.","commonSituations":"Inspector tree open while the runtime reloads; the page navigated/reloaded but DevTools kept stale object references; concurrent inspector sessions sharing ids.","solutions":["Drop cached object references whenever the runtime re-initialises; listen for the runtime-ready signal and clear.","Avoid keeping inspector trees expanded across reloads; collapse them before reloading the page.","If the id was never produced by a real call-function-on response, do not pass it to details."],"exampleFix":"// before: kept id across reload\n_get_cfo_res_details(staleId, args); // throws\n\n// after: invalidate ids on runtime-ready\nmono_wasm_runtime_ready(); // runtime clears _call_function_res_cache\nconst fresh = await mono_wasm_call_function_on({ objectId: rootId, ... });\n_get_cfo_res_details(fresh.objectId, args);","handlingStrategy":"validation","validationCode":"function canGetCfoDetails (objectId) {\n  return typeof objectId === 'string' && objectId in _call_function_res_cache_pub;\n}","typeGuard":"function isCachedObjectId (objId: string, cache: Record<string, unknown>): objId is string {\n  return Object.prototype.hasOwnProperty.call(cache, objId);\n}","tryCatchPattern":"try {\n  return _get_cfo_res_details(objectId, args);\n} catch (e) {\n  if (e instanceof Error && /Could not find any object/.test(e.message)) {\n    // refresh the object reference and retry once\n    const fresh = await mono_wasm_call_function_on({ objectId: rootId, ... });\n    return _get_cfo_res_details(fresh.objectId, args);\n  }\n  throw e;\n}","preventionTips":["Treat runtime re-init as invalidation of all cached cfo ids.","Collapse inspector trees before reloading the page.","Do not share ids across runtime instances or tabs."],"tags":["debugger","object-cache","cdp","lifecycle"],"backgroundTag":null,"analyzedSha":"60108ba66eb7d1d12f595480091b4ad80a24b172","analyzedAt":"2026-08-10T18:54:11.478Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}