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

Downloaded documents cannot be open and message: "Word experienced an error trying to open the file..." appears #249

Open
ocelph opened this issue Jul 25, 2024 · 3 comments

Comments

@ocelph
Copy link

ocelph commented Jul 25, 2024

Hi! So, I am using node.js v22, and using html-to-docx v1.8.0 to convert an html page to docx format. This docx file can then be downloaded when I activated the download button. There are several button and each are for different content. The content is all there as i can see it in the preview however, every time I try to open in I get the following error:

Word experienced an error trying to open the file.
Try these suggestions.

  • Check the file permissions for the document or drive.
  • Make sure there is sufficient free memory and disk space.
  • Open the file with the Text Recovery converter.

My coworker have also try to download the files but we keep getting the same error. We also tried to lower the node version to v16 but the problem persisted. (This is happening on Linux and MacOs)

If you have a solution or any idea of why this could be happening please let me know!

@leafnx
Copy link

leafnx commented Jul 30, 2024

Hello, I encountered the same problem (node.js v16, html-to-docx v1.8.0). For me this seems to occur only in desktop MS Word, but in WordPad, google docs and MS Word online (Microsoft 365) everything works fine. Also I can still open a file in desktop MS Word if I open it in read-only mode manually. Hope it helps.

@shawnthompson
Copy link

We were / are using html-docx-js but switching to html-to-docx and having the problem with both packages. We seemed to have fixed the problem by getting it to create a temporary html file first to a folder on the drive and then converting that file to a docx file, then allowing the user to download it from our app.

See the PR here, using html-docx-js: create temporary file for Word generator by shawnthompson · Pull Request #71 · aaact-aatia/a11y-ict-wizard.

Now I'm working on switching to html-to-docx, and it works.

@rossanodr
Copy link

I'm facing the same issue, any updates?

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

4 participants