Open pilotkid opened 3 years ago
Hello @pilotkid,
Have you tried to replace the absolute path by path.join('snapshot', 'build_report', 'test.docx')
?
Does it work with different templates?
Hello, I have attempted this solution to no avail.
No templates work as expected.
I have also tried moving to a different directory and that did not solve the issue. Hardcoding the path (E.G. C:\snapshot\build_report\test.docx
), or using path.join
does not work.
If I move the template to a different directory it also does not work.
It also does not work when I try to use relative directories.
I also would like to mention that if I use fs
to read the file it works fine, I can read the full contents of the file using:
const data = fs.readFileSync(req.file.path, 'utf8')
console.log(data)
Note: I apologize for the delay I did not see that you replied until now.
Hello @pilotkid,
First, I passed the absolute path to Carbone with: const reportPath = path.join(__dirname, "template.docx");
. I replicated the issue and it is not coming from the readFile. The issue is occurring when Carbone renders as a PDF, it is working when the export file type is a DOCX document. The issue seems to be the communication with Libre Office to convert to PDF. Carbone uses a python gateway converter.py
to communicate with the Libre Office Uno API. The pkg
project is not including the Python environment and it is limited to the node execution. The issue is not related directly to Carbone.
Environment Carbone Version: Carbone 2.1.1 Node Version: 12.16.2 Browsers: N/A Desktop OS: Docker / Ubuntu 20 Other: pkg 4.4.9
Expected Behaviour Carbone finishes generating a report or throws an error
Actual Behaviour Carbone never completes generating the report or throws an error.
Steps to reproduce Steps to reproduce the bug:
node
- it works finepkg -t node12-win main.js
Reproduction Link / Code example
Other comments I have a use case where I cannot have node installed on a client machine (libre office is already installed), so I am using a package called pkg that bundles nodejs with your source into an executable. However once bundled Carbone never is able to render and will just sit there for an infinite period of time (in my case 1 hour before I killed it)