Skip to content

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 for Platforms Paid plan.

Will browser rendering bypass Cloudflare's Bot Protection?

Browser rendering requests are always identified as bots by Cloudflare.

If you are trying to scan your own zone, 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
);
});