I did `yarn add @types/node -D`, but I'm still getting this error
I did
yarn add @types/node -D, but I'm still getting this erroryarn add @types/node -Dsplit method could be helpful in this case. But appreciate your comment.x minutes. So I did it under Settings > Triggers > Cron Triggers of that specific worker (picture). But the worker never triggered and never run? And I can see the errors (picture) but I don't know where to track down the logs! I appreciate any thought!? 

scheduled handler, fetch is for HTTP requests

I need to spin up a new browser each timewhy?


failed: Code generation from strings disallowed for this context whenever an xpath selector is used on @Cloudflare/puppeteer. I understand it's a security measure to restrict the use of createFunction in the worker, but it's necessary for xpaths to work in puppeteer. does anyone have a clue how to work around this?page.waitForXPath(xPathSelector, { visible: true })splitxSettings > Triggers > Cron Triggersfailed: Code generation from strings disallowed for this contextcreateFunctionpage.waitForXPath(xPathSelector, { visible: true }) stack: EvalError: Code generation from strings disallowed for this context
at new Function (<anonymous>)
at createFunction (file://<app-root>/.wrangler/tmp/dev-Ol4QPo/index.js:93195:9)
at interpolateFunction (file://<app-root>/.wrangler/tmp/dev-Ol4QPo/index.js:93214:10)
at get _querySelector (file://<app-root>/.wrangler/tmp/dev-Ol4QPo/index.js:93288:33)
at XPathQueryHandler.waitFor (file://<app-root>/.wrangler/tmp/dev-Ol4QPo/index.js:93374:34)
at Frame2.waitForSelector (file://<app-root>/.wrangler/tmp/dev-Ol4QPo/index.js:102047:32)
at Frame2.waitForXPath (file://<app-root>/.wrangler/tmp/dev-Ol4QPo/index.js:102075:17)
at CDPPage.waitForXPath (file://<app-root>/.wrangler/tmp/dev-Ol4QPo/index.js:100304:29)import puppeteer from '@cloudflare/puppeteer';
import { nanoid } from 'nanoid';
const URLS = [
'https://cloudflare.com',
'https://google.com',
'https://wikipedia.org',
];
export default {
async fetch(_, env) {
let browser;
try {
browser = await puppeteer.launch(env.MYBROWSER);
const processUrl = async (url) => {
const page = await browser.newPage();
await page.goto(url);
let img = await page.screenshot();
const filename = new URL(url).hostname.replace(/^www\./, '').replace(/\./g, '-');
const id = nanoid(5);
await env.BROWSER_KV_DEMO.put(`${filename}_${id}`, img);
await page.close();
};
await Promise.all(URLS.map(processUrl));
} catch (error) {
console.error({ error });
} finally {
if (browser) {
await browser.close();
}
}
return new Response('ok');
},
};Argument of type 'Fetcher' is not assignable to parameter of type 'BrowserWorker'.
Types of property 'fetch' are incompatible.
Type '(input: RequestInfo<unknown, CfProperties<unknown>>, init?: RequestInit<CfProperties<unknown>> | undefined) => Promise<Response>' is not assignable to type '{ (input: RequestInfo | URL, init?: RequestInit | undefined): Promise<Response>; (input: RequestInfo, init?: RequestInit | undefined): Promise<...>; }'.
//env
import { Fetcher } from "@cloudflare/workers-types";
export interface env {
MYBROWSER: Fetcher
}