Closed udayraj21 closed 4 years ago
Hi @udayraj21 đ
Thank you for sharing you issue. Could you provide me the code you used and tell me more about your environment please đ ?
@frinyvonnick I have the same issue
const nodeHtmlToImage = require('node-html-to-image');
export default async (req, res) => {
try {
const image = await nodeHtmlToImage({
html: '<html><body><div><img src="https://domain.com/some_image.png" /><img src="https://domain.com/some_image.png" /></div></body></html>'
});
res.writeHead(200, { 'Content-Type': 'image/png' });
res.end(image, 'binary');
return res;
} catch (e) {
console.log(e);
return res.status(400).json({ error: e });
}
};
env: serverless function in next.js For now I'm testing this on local env
Hi @kuli00, thank you for sharing your issue. Do you use yarn or npm? Which node version do you use?
yarn - 1.21.1 node - 12.14.1
@frinyvonnick any news?
also having this issue ^
In another issue a solution have been posted for Ubuntu. Does it help?
@aarshaw @kuli00 @udayraj21 Did you try the solution in my previous message âď¸ ?
I close this issue, feel free to reopen it if you have further information.
I have installed this library in node js. I am trying to get an image from html but I get UnhandledPromiseRejectionWarning: Error: Browser is not downloaded. Run "npm install" or "yarn install" error always. OS: Ubuntu 18.04 LTS Node: v12.14.1 NPM: 6.14.5
Here is log:
(node:31583) UnhandledPromiseRejectionWarning: Error: Browser is not downloaded. Run "npm install" or "yarn install" at ChromeLauncher.launch (webpack:///./node_modules/puppeteer/lib/Launcher.js?:236:15) at module.exports (webpack:///./node_modules/node-html-to-image/src/index.js?:22:19) at eval (webpack:///./app/helpers/HtmlToImage.js?:12:19) (node:31583) 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:31583) [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.