-
Notifications
You must be signed in to change notification settings - Fork 95
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
The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received undefined #50
Comments
@SCHrodrigo Is libreoffice installed on your linux server? What's the output of |
@elwerene I used "npm i libreoffice-convert --save" to install it in the directory with index.js, which runs the server. The output to
Both command were executed inside the dir with index.js. |
@SCHrodrigo Please install libreoffice as statet in the Readme. This library only works with a preinstalled instance of libreoffice. If that's not an option on your server, then this lib won't help you convert files. Sorry |
Hey, so I just got libreoffice installed, the message from
I confirmed there is a file soffice and soffice.bin, but the Sorry for dragging this. |
@SCHrodrigo no worries, soffice needs to be in "/usr/bin/soffice". you could link it there:
There's an issue to set another installation folder, but nobody actually provided a pr for it yet: #49 |
Hot damn, it worked! Thank you so much for helping! |
fixed after change from path.resolve to join const inputPath = path.join(__dirname, './resources/example.docx');
const outputPath = path.join(__dirname, `/resources/example${ext}`); |
As in the title, there is something going on that the "done" variable is coming up short.
I'm on Linux, using node express to host an API to convert a docx that is generated with docxtemplater based on the answers of a form.
This is the code that is converting:
fs.writeFileSync(path.resolve(__dirname,
/home/ec2-user/oficial_formulario/documentos/Prospeccao/${nome_docx}.docx`), buf);And this is the error coming up:
The first console.log on the code shows the file being converted, so I don't know what's going on.
The text was updated successfully, but these errors were encountered: