Byba
CDCloudflare Developers
•Created by paulc on 8/16/2024 in #workers-help
Browser Rendering worker re-executes before timing out
Hello! Did you fixed it some how? I have the same problem( I created simple example and it started twice. This is my example:
import puppeteer from "@cloudflare/puppeteer";
export default {
async fetch(request, env, ctx) {
console.log('START');
let url = 'https://www.google.com';
const browser = await puppeteer.launch(env.TEST);
const page = await browser.newPage();
// await page.goto(url);
try {
await page.waitForSelector('div#test123', {hidden: false});
} catch (e) {
console.log('WAITING 1')
}
try {
await page.waitForSelector('div#test123', {hidden: false});
} catch (e) {
console.log('WAITING 2')
}
try {
await page.waitForSelector('div#test123', {hidden: false});
} catch (e) {
console.log('WAITING 3')
}
await browser.close();
return new Response('Hello World!');
},
};
5 replies