Puppeteer: 'clip' and 'fullPage' are mutually exclusive
Screenshot options contain both clip and fullPage.
Screenshot options contain both clip and fullPage.
Error message
'clip' and 'fullPage' are mutually exclusive
How this error happens
clip selects a rectangle, while fullPage selects the entire document. Puppeteer cannot apply both instructions to one screenshot.
The snippets use an open Puppeteer page named page.
await page.screenshot({
fullPage: true,
clip: {
x: 0,
y: 0,
width: 640,
height: 480,
},
});
How to fix
Choose either the full document or a clipped rectangle. For a full-page screenshot, remove clip.
await page.screenshot({
fullPage: true,
});
Things to keep in mind
For a region screenshot, keep clip and omit fullPage.