Skip to content
Cloudflare Docs

FAQ

Below you will find answers to our most commonly asked questions. If you cannot find the answer you are looking for, refer to the Discord to explore additional resources.

Uncaught (in response) TypeError: Cannot read properties of undefined (reading 'fetch')

Make sure that you are passing your Browser binding to the puppeteer.launch api and that you have Workers Paid plan.

Will browser rendering bypass Cloudflare's Bot Protection?

No, Browser Rendering requests are always identified as bots by Cloudflare and do not bypass Bot Protection. Additionally, Browser Rendering respects the robots.txt protocol, ensuring that any disallowed paths specified for user agents are not accessed during rendering.

If you are attempting to scan your own zone and need Browser Rendering to access areas protected by Cloudflare’s Bot Protection, you can create a WAF skip rule to bypass the bot protection using a header or a custom user agent.

Puppeteer

Code generation from strings disallowed for this context while using an Xpath selector

Currently it's not possible to use Xpath to select elements since this poses a security risk to Workers.

As an alternative try to use a css selector or page.evaluate for example:

const innerHtml = await page.evaluate(() => {
return (
// @ts-ignore this runs on browser context
new XPathEvaluator()
.createExpression("/html/body/div/h1")
// @ts-ignore this runs on browser context
.evaluate(document, XPathResult.FIRST_ORDERED_NODE_TYPE).singleNodeValue
.innerHTML
);
});