{"record":{"id":"77d51703a47ab495","repo":"wavetermdev/waveterm","slug":"error-waiting-for-vdom-context-route-v","errorCode":null,"errorMessage":"error waiting for vdom context route: %v","messagePattern":"error waiting for vdom context route: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/waveapp/waveapp.go","lineNumber":215,"sourceCode":"}\n\nfunc (c *Client) CreateVDomContext(target *vdom.VDomTarget) error {\n\tblockORef, err := wshclient.VDomCreateContextCommand(\n\t\tc.RpcClient,\n\t\tvdom.VDomCreateContext{Target: target},\n\t\t&wshrpc.RpcOpts{Route: wshutil.MakeFeBlockRouteId(c.RpcContext.BlockId)},\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\tc.VDomContextBlockId = blockORef.OID\n\tlog.Printf(\"created vdom context: %v\\n\", blockORef)\n\tgotRoute, err := wshclient.WaitForRouteCommand(c.RpcClient, wshrpc.CommandWaitForRouteData{\n\t\tRouteId: wshutil.MakeFeBlockRouteId(blockORef.OID),\n\t\tWaitMs:  4000,\n\t}, &wshrpc.RpcOpts{Timeout: 5000})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error waiting for vdom context route: %v\", err)\n\t}\n\tif !gotRoute {\n\t\treturn fmt.Errorf(\"vdom context route could not be established\")\n\t}\n\twshclient.EventSubCommand(c.RpcClient, wps.SubscriptionRequest{Event: wps.Event_BlockClose, Scopes: []string{\n\t\tblockORef.String(),\n\t}}, nil)\n\tc.RpcClient.EventListener.On(\"blockclose\", func(event *wps.WaveEvent) {\n\t\tc.doShutdown(\"got blockclose event\")\n\t})\n\treturn nil\n}\n\nfunc (c *Client) SendAsyncInitiation() error {\n\tif c.VDomContextBlockId == \"\" {\n\t\treturn fmt.Errorf(\"no vdom context block id\")\n\t}\n\tif c.GetIsDone() {","sourceCodeStart":197,"sourceCodeEnd":233,"githubUrl":"https://github.com/wavetermdev/waveterm/blob/a4447c1563b2df285ab89e76c82f91e1a1a49c1e/pkg/waveapp/waveapp.go#L197-L233","documentation":"CreateVDomContext registers a vdom context for the block and then waits for Wave's frontend to open the corresponding block route, using WaitForRouteCommand with a 4000ms wait and 5000ms RPC timeout. This error wraps a failure of that wait call itself — RPC timeout, transport error, or command rejection — meaning the client could not even complete the wait operation against the frontend route.","triggerScenarios":"Calling CreateVDomContext when the Wave frontend is not rendering the block, the frontend process is busy/frozen so the 5000ms RpcOpts.Timeout expires, or the block OID in blockORef is invalid.","commonSituations":"Headless/minimized Wave where the frontend never spins up the block; slow machine exceeding the 5s timeout; block closed between creation and the wait; invalid OID from a stale block reference.","solutions":["Ensure the Wave window is open and the block is visible/rendering.","Retry; transient frontend slowness can exceed the 5s timeout.","Verify the blockORef OID matches a live block (not closed or from an old session).","Increase the RpcOpts.Timeout if running on a heavily loaded machine.","Check Wave logs for frontend errors creating the vdom context route."],"exampleFix":"// before\ngotRoute, err := wshclient.WaitForRouteCommand(c.RpcClient, wshrpc.CommandWaitForRouteData{RouteId: ..., WaitMs: 4000}, &wshrpc.RpcOpts{Timeout: 5000})\n// after: longer timeout for slow frontends\ngotRoute, err := wshclient.WaitForRouteCommand(c.RpcClient, wshrpc.CommandWaitForRouteData{RouteId: ..., WaitMs: 10000}, &wshrpc.RpcOpts{Timeout: 12000})","handlingStrategy":"try-catch","validationCode":"if blockORef.OID == \"\" {\n    return fmt.Errorf(\"cannot wait for vdom route: empty block OID\")\n}\n// ensure the Wave window/block is open and rendering before waiting","typeGuard":null,"tryCatchPattern":"gotRoute, err := wshclient.WaitForRouteCommand(c.RpcClient, wshrpc.CommandWaitForRouteData{\n    RouteId: wshutil.MakeFeBlockRouteId(blockORef.OID),\n    WaitMs:  4000,\n}, &wshrpc.RpcOpts{Timeout: 5000})\nif err != nil {\n    return fmt.Errorf(\"error waiting for vdom context route: %v\", err)\n}\nif !gotRoute {\n    return fmt.Errorf(\"vdom context route could not be established\")\n}","preventionTips":["Ensure the block is visible and the Wave window is open before initializing vdom.","Increase RpcOpts.Timeout on slow machines.","Verify the block OID is from the current session.","Check Wave renderer logs if timeouts repeat."],"tags":["rpc","timeout","vdom","frontend"],"backgroundTag":"route-wait-timeout","analyzedSha":"a4447c1563b2df285ab89e76c82f91e1a1a49c1e","analyzedAt":"2026-09-01T15:26:23.972Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}