{"record":{"id":"9738f838432b4bda","repo":"wavetermdev/waveterm","slug":"vdom-context-route-could-not-be-established","errorCode":null,"errorMessage":"vdom context route could not be established","messagePattern":"vdom context route could not be established","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/waveapp/waveapp.go","lineNumber":218,"sourceCode":"\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() {\n\t\treturn fmt.Errorf(\"client is done\")\n\t}\n\treturn wshclient.VDomAsyncInitiationCommand(","sourceCodeStart":200,"sourceCodeEnd":236,"githubUrl":"https://github.com/wavetermdev/waveterm/blob/a4447c1563b2df285ab89e76c82f91e1a1a49c1e/pkg/waveapp/waveapp.go#L200-L236","documentation":"The WaitForRouteCommand RPC completed without error but reported gotRoute == false: the frontend block route (MakeFeBlockRouteId of the vdom context block) did not appear within the 4000ms wait window. This means Wave's frontend never started listening on the block route, so RPCs targeted at the vdom context would have nowhere to go.","triggerScenarios":"Calling CreateVDomContext when the block's frontend component failed to mount, the block is minimized/backgrounded and vdom was never initialized, or the frontend route registration takes longer than 4000ms on a loaded machine.","commonSituations":"Very large vdom apps delaying frontend mount; Wave renderer crashed for that block; race where the app starts before the frontend finished loading the block.","solutions":["Confirm the block is actively rendered in the Wave window and reload the block if needed.","Restart the app so CreateVDomContext races less with frontend startup.","Increase WaitMs in CommandWaitForRouteData (e.g. to 10000) to tolerate slow frontend mounts.","Check the browser/renderer console in Wave for vdom context initialization errors.","Verify the vdom context type/name matches what the frontend component expects."],"exampleFix":"// before\nWaitMs: 4000,\n// after\nWaitMs: 10000, // tolerate slow frontend route registration","handlingStrategy":"retry","validationCode":"if blockORef.OID == \"\" {\n    return fmt.Errorf(\"cannot wait for vdom route: empty block OID\")\n}","typeGuard":null,"tryCatchPattern":"gotRoute, err := wshclient.WaitForRouteCommand(c.RpcClient, wshrpc.CommandWaitForRouteData{\n    RouteId: wshutil.MakeFeBlockRouteId(blockORef.OID),\n    WaitMs:  10000,\n}, &wshrpc.RpcOpts{Timeout: 12000})\nif err == nil && !gotRoute {\n    // one retry after brief delay to absorb frontend startup races\n    time.Sleep(500 * time.Millisecond)\n    gotRoute, err = wshclient.WaitForRouteCommand(...)\n}","preventionTips":["Give the frontend time to mount before/while waiting (increase WaitMs).","Reload the block if its renderer appears stuck.","Start the app only after the block content has loaded.","Check the Wave browser console for vdom mount errors."],"tags":["vdom","timeout","frontend","route"],"backgroundTag":"route-wait-timeout","analyzedSha":"a4447c1563b2df285ab89e76c82f91e1a1a49c1e","analyzedAt":"2026-09-01T15:26:23.972Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}