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

Unable to get browser page #172

Open
Onctaaf opened this issue Jun 27, 2022 · 5 comments
Open

Unable to get browser page #172

Onctaaf opened this issue Jun 27, 2022 · 5 comments
Labels
question Further information is requested

Comments

@Onctaaf
Copy link

Onctaaf commented Jun 27, 2022

My code does nothing and after a while leaves the following error:

(node:67808) UnhandledPromiseRejectionWarning: Error: Unable to get browser page
    at Worker.<anonymous> (G:\ONEDRIVE\\{DIRECTORY}\School\html-to-image-test\node_modules\puppeteer-cluster\dist\Worker.js:41:31)
    at Generator.next (<anonymous>)
    at fulfilled (G:\ONEDRIVE\{DIRECTORY}\School\html-to-image-test\node_modules\puppeteer-cluster\dist\Worker.js:5:58)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
(node:67808) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:67808) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

I tried creating a completely fresh project and only put in the following code in my index.js. This code is traight from the readme but still produced the exact same error. Weirdly, my code worked perfectly fine yesterday.

const nodeHtmlToImage = require('node-html-to-image')

nodeHtmlToImage({
  output: './image.png',
  html: '<html><body>Hello world!</body></html>'
})
  .then(() => console.log('The image was created successfully!'))
@rChahine
Copy link

@Onctaaf did you find a solution ?

@frinyvonnick
Copy link
Owner

I just released 3.3.0 version which contain a feature to customise which puppeteer library node-html-to-image uses. It might help you making node-html-to-image work in a cloud context. Here is the documentation : https://github.com/frinyvonnick/node-html-to-image#using-different-puppeteer-libraries

Could you close the issue if it fixes it, please?

@shaikdvara
Copy link

issue, not at fixed

@frinyvonnick
Copy link
Owner

@shaikdvara could you provide more information that might help fixing the issue?

@frinyvonnick frinyvonnick added the question Further information is requested label Aug 5, 2023
@dgsmith7
Copy link

dgsmith7 commented Aug 10, 2024

I had this same problem. My project was working fine and this problem happened "out of the blue". For me, the solution was this: I deleted my node_modules folder, deleted my package-lock.json, then executed npm install. Once everything was reinstalled the project worked fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants