Minimal, reproducible example
import puppeteer from "puppeteer";
const args = [
"--no-sandbox",
"--disable-setuid-sandbox",
"--disable-dev-shm-usage",
"--disable-accelerated-2d-canvas",
"--no-first-run",
"--no-zygote",
"--single-process",
"--disable-gpu",
];
const browser = await puppeteer.launch({
headless: true,
args,
dumpio: true,
});
const page = await browser.newPage();
const filePath = `xxx`;
await page.setContent(html, {
waitUntil: "networkidle2",
});
await page.pdf({ path: filePath, format: "A4" });
await browser.close();
Error string
Target.createTarget timed out. Increase the 'protocolTimeout' setting in launch/connect calls for a higher timeout if needed.
Bug behavior
Background
No response
Expectation
I should be able to generate a PDF.
Reality
I received logs from dumpio.
[39:65:0622/134509.454880:ERROR:shared_image_stub.cc(744)] SharedImageStub: unable to create context
[39:65:0622/134509.454882:ERROR:gpu_channel.cc(789)] GpuChannel: Failed to create SharedImageStub
[39:65:0622/134509.454916:ERROR:check.cc(375)] Check failed: false. NOTREACHED log messages are omitted in official builds. Sorry!
[39:65:0622/134509.454925:ERROR:gpu_channel_manager.cc(959)] Failed to create GLES3 context, fallback to GLES2.
[39:65:0622/134509.454926:ERROR:check.cc(375)] Check failed: false. NOTREACHED log messages are omitted in official builds. Sorry!
[39:65:0622/134509.454933:ERROR:gpu_channel_manager.cc(970)] ContextResult::kFatalFailure: Failed to create shared context for virtualization.
Puppeteer configuration file (if used)
var path = require("path");
/**
* @type {import("puppeteer").Configuration}
*/
module.exports = {
cacheDirectory: path.join(path.resolve(__dirname), ".cache", "puppeteer"),
};
Puppeteer version
22.12.0
Node version
20.14.0
Package manager
npm
Package manager version
10.2.3
Operating system
Linux
Minimal, reproducible example
Error string
Target.createTarget timed out. Increase the 'protocolTimeout' setting in launch/connect calls for a higher timeout if needed.
Bug behavior
Background
No response
Expectation
I should be able to generate a PDF.
Reality
I received logs from dumpio.
Puppeteer configuration file (if used)
Puppeteer version
22.12.0
Node version
20.14.0
Package manager
npm
Package manager version
10.2.3
Operating system
Linux