{"record":{"id":"8efceb518b499b5a","repo":"NousResearch/hermes-agent","slug":"marketplace-install-is-only-available-in-the-deskt","errorCode":null,"errorMessage":"Marketplace install is only available in the desktop app.","messagePattern":"Marketplace install is only available in the desktop app\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"apps/desktop/src/themes/install.ts","lineNumber":86,"sourceCode":"    ...(darkTerminal ? { darkTerminal } : {})\n  }\n}\n\n/**\n * Download a Marketplace extension and install the theme family it contributes\n * (see `buildThemeFromMarketplace`). Returns the single installed theme.\n */\nexport async function installVscodeThemeFromMarketplace(id: string): Promise<DesktopTheme> {\n  const trimmed = id.trim()\n\n  if (!MARKETPLACE_ID_RE.test(trimmed)) {\n    throw new Error('Expected a Marketplace id like \"publisher.extension\".')\n  }\n\n  const api = window.hermesDesktop?.themes\n\n  if (!api?.fetchMarketplace) {\n    throw new Error('Marketplace install is only available in the desktop app.')\n  }\n\n  const result = await api.fetchMarketplace(trimmed)\n\n  return installUserTheme(buildThemeFromMarketplace(result))\n}\n","sourceCodeStart":68,"sourceCodeEnd":93,"githubUrl":"https://github.com/NousResearch/hermes-agent/blob/c896c09c42910c584c4c7d2325b58c14713ea42c/apps/desktop/src/themes/install.ts#L68-L93","documentation":"Thrown by installVscodeThemeFromMarketplace when window.hermesDesktop?.themes?.fetchMarketplace is absent — the preload-API bridge that downloads Marketplace extensions only exists inside the Electron desktop app. Running the same code in a plain browser (dashboard web build) or in tests without the desktop preload yields undefined and this error.","triggerScenarios":"Importing and calling installVscodeThemeFromMarketplace outside Electron (dashboard in a browser, vitest/jsdom without mocking window.hermesDesktop), or on an older desktop build whose preload does not expose themes.fetchMarketplace.","commonSituations":"Shared theme code executed by the web dashboard, unit tests forgetting to stub the preload API, or a Desktop version predating the Marketplace installer API.","solutions":["Only offer Marketplace install in the Electron app; feature-gate the UI on !!window.hermesDesktop?.themes?.fetchMarketplace.","In tests, stub window.hermesDesktop with a fake fetchMarketplace before invoking.","Update Hermes Desktop if the preload bridge is missing in your installed build."],"exampleFix":"// before\nconst theme = await installVscodeThemeFromMarketplace(id)\n\n// after\nif (!window.hermesDesktop?.themes?.fetchMarketplace) {\n  throw new Error('Marketplace install requires the desktop app')\n}\nconst theme = await installVscodeThemeFromMarketplace(id)","handlingStrategy":"type-guard","validationCode":"const canInstallFromMarketplace = (): boolean =>\n  typeof window !== 'undefined' && Boolean(window.hermesDesktop?.themes?.fetchMarketplace)","typeGuard":"function hasMarketplaceApi(wp: typeof window): wp is typeof window & {\n  hermesDesktop: { themes: { fetchMarketplace: (id: string) => Promise<DesktopMarketplaceThemeResult> } }\n} {\n  return Boolean(wp?.hermesDesktop?.themes?.fetchMarketplace)\n}","tryCatchPattern":null,"preventionTips":["Feature-gate Marketplace install UI on presence of the preload API.","Stub window.hermesDesktop in vitest setups for shared code paths.","Version-check the preload bridge after app updates before offering the feature."],"tags":["desktop","themes","preload-api","environment"],"backgroundTag":null,"analyzedSha":"c896c09c42910c584c4c7d2325b58c14713ea42c","analyzedAt":"2026-08-14T17:18:01.089Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}