From f9baac34ccd514edf31c1e8d06bc1a0f0f26452e Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sun, 19 Apr 2026 12:10:08 +0300 Subject: [PATCH] fix(ocr): use correct officeparser v6.1.0 API v6.1.0 renamed parseOfficeAsync to OfficeParser.parseOffice (static method) and returns an AST object with toText() instead of a plain string. Co-Authored-By: Claude Opus 4.6 (1M context) --- .../server/src/services/ocr/processors/office_processor.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/apps/server/src/services/ocr/processors/office_processor.ts b/apps/server/src/services/ocr/processors/office_processor.ts index cb6b5f0a27..42e4c7bb24 100644 --- a/apps/server/src/services/ocr/processors/office_processor.ts +++ b/apps/server/src/services/ocr/processors/office_processor.ts @@ -1,5 +1,4 @@ -import officeparser from 'officeparser'; -import type { OfficeParserConfig } from 'officeparser'; +import { OfficeParser, type OfficeParserConfig } from 'officeparser'; import log from '../../log.js'; import { OCRProcessingOptions, OCRResult } from '../ocr_service.js'; @@ -45,8 +44,8 @@ export class OfficeProcessor extends FileProcessor { log.info(`Starting Office document text extraction for ${mimeType}...`); - const text = await officeparser.parseOfficeAsync(buffer, PARSER_CONFIG); - const trimmed = text.trim(); + const ast = await OfficeParser.parseOffice(buffer, PARSER_CONFIG); + const trimmed = ast.toText().trim(); return { text: trimmed,