node-html-to-image icon indicating copy to clipboard operation
node-html-to-image copied to clipboard

ERROR: Not found

Open moazam1 opened this issue 3 years ago • 2 comments

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.

moazam1 avatar Jan 01 '22 18:01 moazam1

Hi @moazam1 👋

Thank you for opening this issue. Can you share the stacktrace of the error please?

frinyvonnick avatar Feb 06 '22 16:02 frinyvonnick

@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.

moazam1 avatar Feb 15 '22 17:02 moazam1