Skip to content

"cloudflare.ai.toMarkdown.transform" does not work #2696

@Lqm1

Description

@Lqm1

Confirm this is a Typescript library issue and not an underlying Cloudflare API issue

  • This is an issue with the Typescript library

Describe the bug

I pass the correct arguments, but I get an API error.
I think there is a difference in specifications between packages and APIs.

Error: 400 {"errors":[{"message":"Request body is not valid multipart/form-data","code":6005}],"success":false,"result":{},"messages":[]}
    at async Object.handler (D:\Desktop\Projects\aporo-app\.next\dev\server\chunks\ssr\[root-of-the-server]__65d2dc2c._.js:738:24)
    at async (D:\Desktop\Projects\aporo-app\.next\dev\server\chunks\ssr\[root-of-the-server]__65d2dc2c._.js:310:16) {
  status: 400,
  headers: [Object],
  error: [Object],
  errors: [Array]
}

To Reproduce

1, call cloudflare.ai.toMarkdown.transform

Code snippets

const { result } = await cloudflare.ai.toMarkdown.transform(
			await toFile(Buffer.from(html), "page.html"), // html is string, same error pass html
			{
				account_id: env.CLOUDFLARE_ACCOUNT_ID,
			},
		);

OS

windows

Runtime version

node v24.11.1

Library version

5.2.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind: bugCategorizes issue or PR as related to a bug.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions