-
-
Notifications
You must be signed in to change notification settings - Fork 60
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
The CHROME_PATH environment variable must be set to a Chrome/Chromium executable no older than Chrome stable. #665
Comments
What is your chrome(ium) version? |
Version 124.0.6367.118 (Official Build) (64-bit) |
Is Chrome installed on your GCP instance? If so, what version? |
we have used GCP serverless, and did not use any instance. |
Html-pdf-chrome requires chrome. You'll likely need a dedicated instance running with a port exposed that your serverless functions can connect to and use. |
ok, thank you. I need another question I have printed more than 2000 pages it takes more than 20 minutes, how can I shorten the print pdf? |
If you have one instance of Chrome running, monitor its CPU/memory usage. You may need to limit the concurrency of how many simultaneous PDFs you are generating. If the 2000 pages is a single PDF, consider splitting it up into smaller jobs. |
const pdf = require('html-pdf-chrome');
let options = {
printOptions: {
format: "A4",
landscape: false,
marginTop: marginTop,
marginBottom: marginBottom,
marginLeft: marginLeft,
marginRight: marginRight,
displayHeaderFooter: true,
headerTemplate: headerTpl,
footerTemplate: footerTpl,
},
chromeFlags: ['--headless', '--disable-gpu', '--disable-web-security', '--no-sandbox', '--disable-setuid-sandbox']
};
message: 'The CHROME_PATH environment variable must be set to a Chrome/Chromium executable no older than Chrome stable.',
code: 'ERR_LAUNCHER_PATH_NOT_SET'
}
I have to run in gcp serverless Api
how to solve this error
node version - 16
html-pdf-chrome version - 0.8.4,
The text was updated successfully, but these errors were encountered: