await puppeteer.launch(this.env.MYBROWSER); for a "normal" puppeteer for local testing? I'm aware that wrangler dev --remote should be used ,but this causes other problems (e.g. that queues are not working there and durable objects seem to have issues for this env as well)puppeteer package doesn't launch (some node stuff is missing) it's working with connect to services like browserless. Think that's good enough for me right now. Gonna see if there's some opensource version of a websocket server for puppeteerwrangler dev this.browser = await puppeteer.connect({ browserWSEndpoint: ws://localhost:3000 });
Trace resource limit exceeded; subsequent logs not recorded.. I'm guessing if you're doing browser stuff, you probably need to switch your worker types to unbounded?Median CPU Time 51.7 ms so will switch this one to unbound, ty!Buffer is not defined, which is a bit odd (same for .text() and .json()):pages.on was behaving very strangely so gave this a whirl insteadcompatibility_flags = [ "nodejs_compat" ] in my wrangler.toml)await puppeteer.launch(this.env.MYBROWSER);puppeteerlaunchconnectthis.browser = await puppeteer.connect({ browserWSEndpoint: });const browser = await puppeteer.launch(env.BROWSER);
const page = await browser.newPage();
await page.goto(`https://www.some-page.com`);
const html = await page.content()Trace resource limit exceeded; subsequent logs not recorded.Median CPU Time 51.7 msBuffer is not definedconst [res] = await Promise.all([
page.waitForResponse(res => res.url().includes('something') && res.request().method().toUpperCase() != "OPTIONS"),
page.goto('https://example.com', {waitUntil: "domcontentloaded"}),
]);
console.log(await res?.buffer())pages.oncompatibility_flags = [ "nodejs_compat" ]page.on('response', async(response) => {
const request = response.request();
if (request.url().includes('something')) {
console.log(123);
const text = await response.text();
console.log(text);
console.log(456);
}
})