TS SDK - Error parsing MSFT DOCX and PPTX File Types - I suspect LlamaParseReader is applying wrong MIME Type #290

Closed
opened 2026-02-16 00:17:23 -05:00 by yindo · 0 comments
Owner

Originally created by @ajpanyteam on GitHub (Oct 8, 2024).

Describe the bug

Using the llamaIndex TS SDK v0.6.17.

llamaParse works for PDF and XLSX files but fails for PPTX and DOCX file types only.

The following error message is received on loadDataAsContent: Error while parsing the file: Failed to parse the file f827....

I suspect this is related to https://github.com/run-llama/LlamaIndexTS/issues/1006 because I added a breakpoint to LlamaParseReader and saw a different MIME Type get applied, details are in Additional Content section below.

Write a concise description of what the bug is

Using the following code returns “Error while parsing the file: Failed to parse the file”:

      const file = storage.bucket(process.env.GCP_BUCKET).file(fileId);
      const [buffer] = await file.download();

      const getMetadata = await file.getMetadata();
      console.log(getMetadata[0].contentType)

      const reader = new LlamaParseReader({
        resultType: "markdown",
        skipDiagonalText: true,
        verbose: true,
      });

      const unt8Array = new Uint8Array(buffer);
      const documents = await reader.loadDataAsContent(unt8Array); // --->  Error while parsing the file: Failed to parse the file: c8e8b079-f3aa-4786-bfe3-e9b3981812cf, status: ERROR

Files

  • wget "https://meetings.wmo.int/Cg-19/PublishingImages/SitePages/FINAC-43/7%20-%20EC-77-Doc%205%20Financial%20Statements%20for%202022%20(FINAC).pptx" -O data/presentation.ppt
    ppx source file from llamaParse github

  • The error occurs with all PPTX files I have tested so far.

Job ID
If you have it, please provide the ID of the job you ran.
You can find it here: https://cloud.llamaindex.ai/parse in the "History" tab.

  • ac0c1b4a-915f-4d00-9340-25506d085f33
  • f8275764-361f-4fd9-ac6d-634193c556b2
  • c8e8b079-f3aa-4786-bfe3-e9b3981812cf

Above jobIds are from my console output. My cloud.llamaindex.ai history tab does not have these jobs.

Screenshots
Feel free to also provide screenshots if relevant.

image

Client:
Please remove untested options:

  • Frontend (cloud.llamaindex.ai)
  • Typescript Library "llamaindex": "0.6.17"

Options
What options did you use? Multimodal, fast mode, parsing instructions, etc.

  • Refer to code sample above.

Additional context

  • XLST, DOCS and PDF fileswork just fine.
  • When I use cloud.llamaindex.ai to parse the PPTX file, it only works with Accurate mode enabled (not surprisingly, as it uses OCR) and is able to process the referenced PPTX file. The UI states, “Default mode, no need to set accurate_mode=true on API” so I assume the llamaParse settings I am using are correct. I could not find any option to set accurate_mode, thus I assume it is set as default.
  • Digging into the SDK, I added a breakpoint inside the SDK on LlamaParseReader createJob. The PPT MimeType applied is application/vnd.oasis.opendocument.spreadsheet
    image

Sample of a pptx

image
Originally created by @ajpanyteam on GitHub (Oct 8, 2024). **Describe the bug** Using the llamaIndex TS SDK v0.6.17. llamaParse works for PDF and XLSX files but fails for PPTX and DOCX file types only. The following error message is received on `loadDataAsContent`: _Error while parsing the file: Failed to parse the file f827...._ I suspect this is related to https://github.com/run-llama/LlamaIndexTS/issues/1006 because I added a breakpoint to LlamaParseReader and saw a different MIME Type get applied, details are in **Additional Content** section below. **Write a concise description of what the bug is** Using the following code returns “Error while parsing the file: Failed to parse the file”: ``` const file = storage.bucket(process.env.GCP_BUCKET).file(fileId); const [buffer] = await file.download(); const getMetadata = await file.getMetadata(); console.log(getMetadata[0].contentType) const reader = new LlamaParseReader({ resultType: "markdown", skipDiagonalText: true, verbose: true, }); const unt8Array = new Uint8Array(buffer); const documents = await reader.loadDataAsContent(unt8Array); // ---> Error while parsing the file: Failed to parse the file: c8e8b079-f3aa-4786-bfe3-e9b3981812cf, status: ERROR ``` **Files** - ```wget "https://meetings.wmo.int/Cg-19/PublishingImages/SitePages/FINAC-43/7%20-%20EC-77-Doc%205%20Financial%20Statements%20for%202022%20(FINAC).pptx" -O data/presentation.ppt``` [ppx source file from llamaParse github](https://github.com/run-llama/llama_parse/blob/main/examples/other_files/demo_ppt_financial.ipynb) - The error occurs with all PPTX files I have tested so far. **Job ID** If you have it, please provide the ID of the job you ran. You can find it here: https://cloud.llamaindex.ai/parse in the "History" tab. - ac0c1b4a-915f-4d00-9340-25506d085f33 - f8275764-361f-4fd9-ac6d-634193c556b2 - c8e8b079-f3aa-4786-bfe3-e9b3981812cf Above jobIds are from my console output. My cloud.llamaindex.ai history tab does not have these jobs. **Screenshots** Feel free to also provide screenshots if relevant. <img width="838" alt="image" src="https://github.com/user-attachments/assets/c6f2318c-9108-4931-9543-57455c795c1b"> **Client:** Please remove untested options: - Frontend (cloud.llamaindex.ai) - Typescript Library ```"llamaindex": "0.6.17"``` **Options** What options did you use? Multimodal, fast mode, parsing instructions, etc. - Refer to code sample above. **Additional context** - XLST, DOCS and PDF fileswork just fine. - When I use cloud.llamaindex.ai to parse the PPTX file, it only works with Accurate mode enabled (not surprisingly, as it uses OCR) and is able to process the referenced PPTX file. The UI states, “_Default mode, no need to set accurate_mode=true on API_” so I assume the llamaParse settings I am using are correct. I could not find any option to set accurate_mode, thus I assume it is set as default. - Digging into the SDK, I added a breakpoint inside the SDK on LlamaParseReader `createJob`. The PPT MimeType applied is **application/vnd.oasis.opendocument.spreadsheet** ![image](https://github.com/user-attachments/assets/85af9234-70b6-47c2-9ebb-6be1821bcd1c) Sample of a pptx <img width="1048" alt="image" src="https://github.com/user-attachments/assets/ed4a5f27-41bd-4f8d-9e6a-4e91b1c96c15">
yindo added the bug label 2026-02-16 00:17:23 -05:00
yindo closed this issue 2026-02-16 00:17:23 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: run-llama/llama_cloud_services#290