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

html-pdf: Unknown Error throw new ERR_INVALID_ARG_TYPE(name, 'string', value); Docker #696

Open
Shijors opened this issue Dec 16, 2022 · 1 comment

Comments

@Shijors
Copy link

Shijors commented Dec 16, 2022

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. (/app/dist/node_modules/phantomjs-prebuilt/bin/phantomjs:22:10)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
at internal/main/run_main_module.js:17:47 {
code: 'ERR_INVALID_ARG_TYPE'
}

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){
}
});

@hypo-thesis
Copy link

did you ever solve this?

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