{"record":{"id":"3ce1a78234dd8b6f","repo":"chatboxai/chatbox","slug":"third-party-parser-not-supported-in-chat","errorCode":null,"errorMessage":"third_party_parser_not_supported_in_chat","messagePattern":"third_party_parser_not_supported_in_chat","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/renderer/stores/sessionHelpers.ts","lineNumber":494,"sourceCode":"  }\n\n  // Store content to unique key\n  await storage.setBlob(uniqKey, content)\n\n  return { content, storageKey: uniqKey, tokenCountMap: {}, parserType: 'chatbox-ai' }\n}\n\n/**\n * Parse file using MinerU service (Desktop only)\n */\nasync function parseFileWithMineruService(\n  file: File,\n  uniqKey: string,\n  apiToken: string\n): Promise<{ content: string; storageKey: string; tokenCountMap: Record<string, number>; parserType: string }> {\n  // Check if platform supports MinerU parsing\n  if (!platform.parseFileWithMineru) {\n    throw new Error('third_party_parser_not_supported_in_chat')\n  }\n\n  // Call platform method to parse file\n  const result = await platform.parseFileWithMineru(file, apiToken)\n\n  // Handle cancellation - throw a special error that will be caught silently\n  if (result.cancelled) {\n    throw new Error('parsing_cancelled')\n  }\n\n  if (!result.success || !result.content || !hasParsedText(result.content)) {\n    throw new Error(EMPTY_ATTACHMENT_CONTENT_ERROR)\n  }\n\n  const content = result.content\n\n  // Store content to unique key\n  await storage.setBlob(uniqKey, content)","sourceCodeStart":476,"sourceCodeEnd":512,"githubUrl":"https://github.com/chatboxai/chatbox/blob/81571269addb6bafb589a920b2883f1e1e084fd1/src/renderer/stores/sessionHelpers.ts#L476-L512","documentation":"Thrown by parseFileWithMineruService when platform.parseFileWithMineru is falsy — i.e. the current runtime has no MinerU integration bound. MinerU is explicitly a Desktop-only feature, so on web or mobile the capability is absent and any non-text file routed to the mineru parser fails here immediately.","triggerScenarios":"The effective document parser config resolved to type 'mineru' (or a caller invoked parseFileWithMineruService directly) while platform.parseFileWithMineru is undefined. The check runs before any network call, so no MinerU request is attempted.","commonSituations":"User synced a config (e.g. via settings import) that selects the MinerU parser onto a mobile/web build that doesn't ship the native bridge; running the renderer in a test harness where the platform shim lacks parseFileWithMineru; desktop build variant where the MinerU plugin failed to register.","solutions":["Switch the document parser to a build-supported option ('local' or 'chatbox-ai') in settings, or run on the Desktop build where parseFileWithMineru is bound.","If you control the platform shim, register a parseFileWithMineru implementation (or a stub that throws a more specific error) so the guard passes.","Gate the parser-config UI so 'mineru' is only selectable when platform.parseFileWithMineru is truthy, preventing users from picking an unsupported option."],"exampleFix":"// before\nif (!platform.parseFileWithMineru) {\n  throw new Error('third_party_parser_not_supported_in_chat')\n}\n// after — fall back to a supported parser instead of hard-failing\nif (!platform.parseFileWithMineru) {\n  return parseFileWithLocalFallback(file, uniqKey, { forceChatboxAIFallback: true })\n}","handlingStrategy":"type-guard","validationCode":"// Before selecting the mineru parser, confirm the platform supports it.\nfunction mineruIsAvailable(): boolean {\n  return Boolean((platform as any).parseFileWithMineru)\n}\nif (parserConfig.type === 'mineru' && !mineruIsAvailable()) {\n  // downgrade to a supported parser or warn the user\n}","typeGuard":"function isMineruSupported(p: typeof platform): p is typeof platform & { parseFileWithMineru: (f: File, t: string) => Promise<unknown> } {\n  return typeof (p as any).parseFileWithMineru === 'function'\n}","tryCatchPattern":"try {\n  return await parseFileWithMineruService(file, uniqKey, apiToken)\n} catch (e) {\n  if (e instanceof Error && e.message === 'third_party_parser_not_supported_in_chat') {\n    return parseFileWithLocalFallback(file, uniqKey, { forceChatboxAIFallback: true })\n  }\n  throw e\n}","preventionTips":["Gate the 'mineru' option in the parser-select UI on platform.parseFileWithMineru so users can't pick an unsupported parser.","Sync parser config per build variant so web/mobile never receive a mineru selection.","Document MinerU as Desktop-only in the settings panel."],"tags":["mineru","platform-capability","desktop-only","config"],"backgroundTag":null,"analyzedSha":"81571269addb6bafb589a920b2883f1e1e084fd1","analyzedAt":"2026-08-12T21:51:44.981Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}