Puppeteer: ScreenRecorder is not available in this environment
ScreenRecorder dependencies are unavailable in this execution environment.
ScreenRecorder dependencies are unavailable in this execution environment.
Error message
ScreenRecorder is not available in this environment
How this error happens
A browser-only or custom runtime may not provide Puppeteer’s Node recording dependencies. Requesting screencast there cannot create a ScreenRecorder.
The failing snippet uses a page named page in a runtime without ScreenRecorder support.
await page.screencast({
path: "/absolute/path/recording.webm",
});
How to fix
Run recording in a supported Node.js environment with its recording dependencies provisioned. A screenshot is an alternative only when a still image satisfies the task.
const image = await page.screenshot({
type: "png",
});
console.log(image.byteLength);
Things to keep in mind
The fix shown intentionally produces a still image, not video. If video is required, change the recording environment instead; retrying the missing constructor will not install its dependencies.