{"record":{"id":"bb3fe18e86c03747","repo":"wavetermdev/waveterm","slug":"no-tab-view-found-for-the-given-webcontents-id","errorCode":null,"errorMessage":"No tab view found for the given webContents id","messagePattern":"No tab view found for the given webContents id","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"emain/emain-ipc.ts","lineNumber":272,"sourceCode":"    electron.ipcMain.on(\"get-cursor-point\", (event) => {\n        const tabView = getWaveTabViewByWebContentsId(event.sender.id);\n        if (tabView == null) {\n            event.returnValue = null;\n            return;\n        }\n        const screenPoint = electron.screen.getCursorScreenPoint();\n        const windowRect = tabView.getBounds();\n        const retVal: Electron.Point = {\n            x: screenPoint.x - windowRect.x,\n            y: screenPoint.y - windowRect.y,\n        };\n        event.returnValue = retVal;\n    });\n\n    electron.ipcMain.handle(\"capture-screenshot\", async (event, rect) => {\n        const tabView = getWaveTabViewByWebContentsId(event.sender.id);\n        if (!tabView) {\n            throw new Error(\"No tab view found for the given webContents id\");\n        }\n        const image = await tabView.webContents.capturePage(rect);\n        const base64String = image.toPNG().toString(\"base64\");\n        return `data:image/png;base64,${base64String}`;\n    });\n\n    electron.ipcMain.on(\"get-env\", (event, varName) => {\n        event.returnValue = process.env[varName] ?? null;\n    });\n\n    electron.ipcMain.on(\"get-about-modal-details\", (event) => {\n        event.returnValue = getWaveVersion() as AboutModalDetails;\n    });\n\n    electron.ipcMain.on(\"get-zoom-factor\", (event) => {\n        event.returnValue = event.sender.getZoomFactor();\n    });\n","sourceCodeStart":254,"sourceCodeEnd":290,"githubUrl":"https://github.com/wavetermdev/waveterm/blob/a4447c1563b2df285ab89e76c82f91e1a1a49c1e/emain/emain-ipc.ts#L254-L290","documentation":"GetDistro iterates the WSL distributions registered on the Windows host and returns the one whose name matches the given wslDistroName. If the loop finishes without a match, it returns this error. It means the requested distro name is not registered in WSL (`wsl -l -v` would not list it).","triggerScenarios":"Calling GetDistro with a Distro name that does not exactly match a registered WSL distribution's Name().","commonSituations":"Typo or case mismatch in the connection config's wslDistro value; distro was unregistered (`wsl --unregister`); distro not yet installed on the machine; stale saved connection pointing at an old distro name.","solutions":["Run `wsl -l -v` (or `wsl --list`) and use the exact distro name in the config","Install the missing distro (`wsl --install -d <name>`)","Fix or remove the stale connection entry referencing the old distro","Check for exact-name/case mismatch (matching is by exact string equality)"],"exampleFix":"// before\nconn := wslconn.GetDistro(ctx, \"Ubuntu-22.04\")\n// after\n// verify name first: run `wsl -l -v`, e.g. it lists \"Ubuntu-22.04 LTS\"\nconn := wslconn.GetDistro(ctx, \"Ubuntu-22.04\") // use exact registered name","handlingStrategy":"validation","validationCode":"out, err := exec.Command(\"wsl\", \"-l\", \"-v\").Output()\nif err == nil && !strings.Contains(strings.ToLower(string(out)), strings.ToLower(distroName)) {\n    return fmt.Errorf(\"distro %q not registered in WSL; run wsl -l -v\", distroName)\n}","typeGuard":null,"tryCatchPattern":"d, err := wslconn.GetDistro(ctx, name)\nif err != nil {\n    if strings.Contains(err.Error(), \"not found\") {\n        // fall back to default distro or prompt user to install\n    }\n}","preventionTips":["Validate the distro name against `wsl -l -v` output before connecting","Store distro names exactly as WSL registers them (case included)","Handle distro removal in ops procedures for machines using saved connections"],"tags":["wsl","distro-not-found","configuration"],"backgroundTag":"wsl-distro-not-found","analyzedSha":"a4447c1563b2df285ab89e76c82f91e1a1a49c1e","analyzedAt":"2026-09-01T15:26:23.972Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}