node-html-to-image
node-html-to-image copied to clipboard
ERROR: Not found
Hi, thanks for creating awesome package. I am not a node pro so trying to understand why below code is throwing: ERROR: not found error. I have taken following code from your docs:
const nodeHtmlToImage = require('node-html-to-image');
nodeHtmlToImage({
output: './image.png',
html: `<html>
<head>
<style>
body {
width: 2480px;
height: 3508px;
}
</style>
</head>
<body>Hello world!</body>
</html>
`
})
.then(() => console.log('The image was created successfully!'))
When I run above code node index.js it generates the image file but I also get this error:
ERROR: Not found
and then I have to press control+c to exit the program. Any idea what am I doing wrong? Thanks once again for your help.
Hi @moazam1 👋
Thank you for opening this issue. Can you share the stacktrace of the error please?
@frinyvonnick Hi, thank you for the reply.
I am using the sample code from your repo:
const nodeHtmlToImage = require('node-html-to-image')
nodeHtmlToImage({
output: './image.png',
html: '<html><body>Hello world!</body></html>'
When I execute the code I get following error:
$ node test.js
ERROR: Not found
Though the process does not terminate automatically but I see image generated.
I am using node: v16.13.1 and [email protected]
I am using temporary solution. Ignoring error not found error and using setimeout to terminate the script. Bit hacky but it works.