Unstructured-IO / unstructured-js-client

A Typescript client for the Unstructured hosted API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error partitioning html files

omikader opened this issue · comments

I've tested multiple html files on unstructured-js-client versions 0.10.0 and 0.9.4 and have been seeing the following error:

Error: Error serializing request body, cause: Cannot read properties of undefined (reading 'toString')

My code looks like this:

const buffer = await this.blob.arrayBuffer();
const content = new Uint8Array(buffer);
const response = await this.client.general.partition(
  {
    chunkingStrategy: "by_title",
    files: { content, fileName: this.fileName },
  },
  undefined,
  // 10 minutes in ms
  { timeout: 600000 },
);

I've narrowed down the offending line in the unstructured-js-client source code but am unsure of how to fix.

Thanks for all the support!

I am noticing this happens with .docx files too

Nvm, this was due to user error -- occasionally I was passing in strategy: undefined as part of the req