Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interface changes since upgrading to 1.6.0 #370

Closed
robin-garnham opened this issue Jul 5, 2023 · 4 comments
Closed

Interface changes since upgrading to 1.6.0 #370

robin-garnham opened this issue Jul 5, 2023 · 4 comments

Comments

@robin-garnham
Copy link

robin-garnham commented Jul 5, 2023

Since upgrading from 1.5.1 to 1.6.0 I had to change the interactions with the library from Buffer to ArrayBuffer.
It's working fine with the below code, but Typescript flags an issue because it's expecting buffer to be type Buffer

Passing in arrayBuffer as the parameter name doesn't work as it throws an error about being unable to find a file in the unzip step.

export async function generateHtmlFromDocx(arrayBuffer: ArrayBuffer) { const { value: html } = await mammoth.convertToHtml({ buffer: arrayBuffer, }); return html; }

@mwilliamson
Copy link
Owner

Are you on node.js or in the browser? Assuming you're on node.js, since you mention using Buffer, why did you have to change from using Buffer to ArrayBuffer?

@robin-garnham
Copy link
Author

Yes, using NodeJS.

When I upgraded versions, I had to start using ArrayBuffer for it work again

My use of the library helps me to implement the feature I requested here: #355

@mwilliamson
Copy link
Owner

What happens when you use a Buffer?

@mwilliamson
Copy link
Owner

Closing due to insufficient information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants