{"record":{"id":"784817794a7e78f4","repo":"iOfficeAI/AionUi","slug":"t-keys-startfailed","errorCode":null,"errorMessage":"t(keys.startFailed)","messagePattern":"t\\(keys\\.startFailed\\)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/desktop/src/renderer/pages/conversation/Preview/components/viewers/OfficeWatchViewer.tsx","lineNumber":212,"sourceCode":"    const start = async () => {\n      setLoading(true);\n      setStatus('starting');\n      setError(null);\n      try {\n        const result = await bridge.start.invoke({ file_path, workspace, file: fileRef });\n        const errorCode = normalizeOfficeWatchErrorCode(result.error);\n        if (errorCode) {\n          setError({\n            code: errorCode,\n            message: t(OFFICE_ERROR_I18N_KEYS[errorCode]),\n          });\n          setLoading(false);\n          return;\n        }\n\n        const url = result.url;\n        if (!url) {\n          throw new Error(t(keys.startFailed));\n        }\n        // Small delay to ensure the watch HTTP server is fully ready for the webview\n        await new Promise((r) => setTimeout(r, 300));\n        if (!cancelled) {\n          const resolvedUrl = resolveOfficeWatchUrl(url, docType);\n          setWatchUrl(resolvedUrl);\n          setLoading(false);\n        }\n      } catch (err) {\n        if (!cancelled) {\n          const backendCode = isBackendHttpError(err) ? normalizeOfficeWatchErrorCode(err.code) : undefined;\n          if (backendCode) {\n            setError({\n              code: backendCode,\n              message: t(OFFICE_ERROR_I18N_KEYS[backendCode]),\n            });\n            setLoading(false);\n            return;","sourceCodeStart":194,"sourceCodeEnd":230,"githubUrl":"https://github.com/iOfficeAI/AionUi/blob/711aa0550ee183ea495dc33e2c05c7943b70a60a/packages/desktop/src/renderer/pages/conversation/Preview/components/viewers/OfficeWatchViewer.tsx#L194-L230","documentation":"start() in OfficeWatchViewer throws t(keys.startFailed) when the IPC call that launches the Office watch HTTP server succeeds (loading ends) but returns a result without a url. The viewer cannot construct a webview URL, so the Office document cannot be previewed.","triggerScenarios":"Invoking the office-watch start IPC and receiving { url: undefined/null }; the Collabora/OnlyOffice watch server process starting but failing to report its listening URL; race where the server exits before reporting.","commonSituations":"Office preview dependency not installed or wrong version, port allocation failure on the main side, or the watch server crashing on malformed .docx/.xlsx files.","solutions":["Check main-process logs for why the watch server returned no URL (crash, port conflict)","Verify the Office preview dependency/binary is installed and its version is supported","Retry opening the document once — transient startup races are common","Convert or re-save a corrupt document and retry"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  const result = await start();\n  if (!result?.url) throw new Error(t(keys.startFailed));\n} catch (e) {\n  // one retry after short delay, then show retry UI\n}","preventionTips":["Verify the office preview dependency is installed before enabling the viewer","Retry start once — watch server startup races are common","Surface a manual 'Retry' button instead of a dead-end error state"],"tags":["office-preview","watch-server","ipc","start-failure"],"backgroundTag":"preview-server-start-failed","analyzedSha":"711aa0550ee183ea495dc33e2c05c7943b70a60a","analyzedAt":"2026-08-28T07:56:06.558Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}