{"record":{"id":"1ebb9013652c5c70","repo":"github/copilot-sdk","slug":"no-canvas-registered-with-id-params-canvasid","errorCode":null,"errorMessage":"No canvas registered with id \"${params.canvasId}\"","messagePattern":"No canvas registered with id \"(.+?)\"","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nodejs/src/session.ts","lineNumber":1394,"sourceCode":"     *\n     * @param canvases - Canvases created via `createCanvas`, or undefined to clear all canvases\n     * @internal Called by the SDK when creating/resuming a session with `canvases`.\n     */\n    registerCanvases(canvases?: Canvas[]): void {\n        this.canvases.clear();\n        if (!canvases || canvases.length === 0) {\n            delete this.clientSessionApis.canvas;\n            return;\n        }\n        for (const canvas of canvases) {\n            this.canvases.set(canvas.declaration.id, canvas);\n        }\n\n        const self = this;\n        this.clientSessionApis.canvas = {\n            async open(params) {\n                const canvas = self.canvases.get(params.canvasId);\n                if (!canvas) throw new Error(`No canvas registered with id \"${params.canvasId}\"`);\n                try {\n                    return (await canvas.open(params)) ?? {};\n                } catch (error) {\n                    throw toCanvasRpcError(error);\n                }\n            },\n            async close(params) {\n                const canvas = self.canvases.get(params.canvasId);\n                if (!canvas) throw new Error(`No canvas registered with id \"${params.canvasId}\"`);\n                try {\n                    if (canvas.onClose) {\n                        await canvas.onClose(params);\n                    }\n                } catch (error) {\n                    throw toCanvasRpcError(error);\n                }\n            },\n            async invoke(params) {","sourceCodeStart":1376,"sourceCodeEnd":1412,"githubUrl":"https://github.com/github/copilot-sdk/blob/cd8cf15dc3f9e762615790aaed0a771a0f392755/nodejs/src/session.ts#L1376-L1412","documentation":"The session's client canvas API open() looks up the requested canvasId in the session's registered canvases map. If no canvas with that id was registered (via session canvas registration), the RPC is rejected with this error rather than returning undefined.","triggerScenarios":"A client calls canvas.open({ canvasId }) with an id never registered on the session, an id registered on a different session, or after the canvas registration was removed.","commonSituations":"Typo or stale canvas id hard-coded in the client; reconnecting to a new session that lacks the previous registration; registration happening after the client's first open attempt (race).","solutions":["Verify the canvasId exactly matches the id used at registration.","Register the canvas on the session (canvases.set / registration API) before the client opens it.","Ensure the client is joined to the session that actually holds the registration."],"exampleFix":"// before\nawait canvas.open({ canvasId: \"main-canvas \" }); // trailing space, unregistered\n// after\nsession.registerCanvas({ canvasId: \"main-canvas\", /* ... */ });\nawait canvas.open({ canvasId: \"main-canvas\" });","handlingStrategy":"validation","validationCode":"const known = new Set(getRegisteredCanvasIds(session));\nif (!known.has(canvasId)) throw new Error(`Canvas \"${canvasId}\" not registered on this session`);","typeGuard":null,"tryCatchPattern":"try { await canvas.open({ canvasId }); } catch (e) { if (String(e.message).startsWith('No canvas registered')) await registerCanvas({ canvasId }) .then(() => canvas.open({ canvasId })); else throw e; }","preventionTips":["Source canvasId from a shared constant, not string literals.","Register all canvases before the client sends open requests.","Re-register canvases on session reconnect."],"tags":["canvas","not-found","rpc"],"backgroundTag":"resource-not-found","analyzedSha":"cd8cf15dc3f9e762615790aaed0a771a0f392755","analyzedAt":"2026-09-09T18:32:31.973Z","contentChangedAt":"2026-09-09T18:32:31.973Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}