{"record":{"id":"4056030b7049a799","repo":"chatboxai/chatbox","slug":"document-parser-not-configured","errorCode":null,"errorMessage":"document_parser_not_configured","messagePattern":"document_parser_not_configured","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/renderer/stores/sessionHelpers.ts","lineNumber":641,"sourceCode":"        rawStorageKey: rawKey,\n        ragMode: 'inline',\n        parserType: 'sandbox-raw',\n      }\n    }\n\n    stage = 'parse'\n    if (isTextFilePath(file.name)) {\n      log.debug(`Text file detected, using local parser: ${file.name}`)\n      result = await parseFileWithLocalFallback(file, uniqKey, {\n        allowChatboxAIFallback: options?.source !== 'pasted-text',\n      })\n    } else {\n      const parserConfig = getEffectiveDocumentParserConfig()\n      log.debug(`Using document parser: ${parserConfig.type} for file: ${file.name}`)\n\n      switch (parserConfig.type) {\n        case 'none': {\n          throw new Error('document_parser_not_configured')\n        }\n\n        case 'local': {\n          result = await parseFileWithLocalFallback(file, uniqKey)\n          break\n        }\n\n        case 'chatbox-ai': {\n          result = await parseFileWithLocalFallback(file, uniqKey, { forceChatboxAIFallback: true })\n          break\n        }\n\n        case 'mineru': {\n          const apiToken = parserConfig.mineru?.apiToken\n          if (!apiToken) {\n            throw new Error('mineru_api_token_required')\n          }\n          try {","sourceCodeStart":623,"sourceCodeEnd":659,"githubUrl":"https://github.com/chatboxai/chatbox/blob/81571269addb6bafb589a920b2883f1e1e084fd1/src/renderer/stores/sessionHelpers.ts#L623-L659","documentation":"Thrown in preprocessFile when the file is not a text file (isTextFilePath false) and getEffectiveDocumentParserConfig().type === 'none'. It is the explicit 'user disabled all document parsing' branch — non-text attachments cannot be processed because no parser is configured.","triggerScenarios":"User attached a binary document (PDF, DOCX, etc.) while the document-parser setting is 'none'. The switch dispatches on parserConfig.type and the 'none' case throws before any parser is invoked. The same string is reused in the default case (227) for unknown types.","commonSituations":"Fresh install where the parser defaults to 'none'; user manually turned off document parsing to save bandwidth; a config import/set-defaults call wrote type:'none'; group policy disabled cloud parsers and the local parser was unset, leaving 'none'.","solutions":["Open Settings → Document Parser and select 'local', 'chatbox-ai', or 'mineru' before attaching non-text files.","Convert the attachment to a plain-text/Markdown file (isTextFilePath returns true) so it bypasses the parser switch entirely.","If shipping a default config, set parserConfig.type to a build-supported default rather than 'none' so users aren't blocked on first attach.","In the UI, disable the attach-button for non-text files when parserConfig.type === 'none' so the user gets guidance instead of a thrown error."],"exampleFix":"// before\ncase 'none': {\n  throw new Error('document_parser_not_configured')\n}\n// after — fall back to the local parser so attachment still works\ncase 'none': {\n  result = await parseFileWithLocalFallback(file, uniqKey)\n  break\n}","handlingStrategy":"validation","validationCode":"// Validate the parser config before attaching a non-text file.\nfunction assertParserConfigured(file: File, cfg: { type: string }): void {\n  if (!isTextFilePath(file.name) && cfg.type === 'none') {\n    throw new Error('Set a document parser in Settings before attaching non-text files.')\n  }\n}","typeGuard":"function isDocumentParserConfigured(cfg: { type: string }): boolean {\n  return cfg.type !== 'none' && ['local','chatbox-ai','mineru'].includes(cfg.type)\n}","tryCatchPattern":"try {\n  await preprocessFile(file)\n} catch (e) {\n  if (e instanceof Error && e.message === 'document_parser_not_configured') {\n    promptUserToConfigureParser()\n    return\n  }\n  throw e\n}","preventionTips":["Default parserConfig.type to a build-supported value ('local') instead of 'none' on fresh installs.","Disable the attach button for non-text files when parserConfig.type === 'none'.","Run a settings-migration step on upgrade that converts legacy 'none' configs to a working default."],"tags":["config","parser-selection","user-action-required","preprocessing"],"backgroundTag":null,"analyzedSha":"81571269addb6bafb589a920b2883f1e1e084fd1","analyzedAt":"2026-08-12T21:51:44.981Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}