node-html-pdf
node-html-pdf copied to clipboard
html-pdf: Unknown Error throw new ERR_INVALID_ARG_TYPE(name, 'string', value); Docker
Error: html-pdf: Unknown Error internal/validators.js:120 throw new ERR_INVALID_ARG_TYPE(name, 'string', value); ^
TypeError [ERR_INVALID_ARG_TYPE]: The "file" argument must be of type string. Received null
at validateString (internal/validators.js:120:11)
at normalizeSpawnArguments (child_process.js:411:3)
at spawn (child_process.js:547:16)
at Object.
at ChildProcess.respond (/app/dist/node_modules/html-pdf/lib/pdf.js:134:17)
at ChildProcess.emit (events.js:314:20)
at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12)
My code was
```let filePath: string = path.resolve(process.cwd(),"public","downloads",fileName);
await pdf.create(htmlcontent, options).toFile(filePath, (err: Error, response: pdf.FileInfo) => { if (err){ } });
did you ever solve this?