
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)compatibility_flags = [ "nodejs_compat" ] in my wrangler.toml file. text: 'workers.api.error.no_access_to_browser_worker [code: 10088]' I guess this is due to gating by the API beta access, correct?0.0.4. Unfortunately I am back to the initial problem at runtime "ReferenceError: Buffer is not defined" when I use the compatibility flagwrangler deploywrangler dev --remotenodejs_compat and updated my imports to look like this. Unfortunately I still get the same result.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" ]compatibility_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);
}
}) // Setup Headless Browser
browser = await puppeteer.launch(env.OG_IMAGE_BROWSER);
page = await browser.newPage();
page.setViewport({ width: 1920, height: 1080, deviceScaleFactor: 2 });
// Open Game Page
await page.goto(`https://steambase.io/games/${appId}`);
await page.waitForSelector('#app-stats-line-chart.loaded');
// Capture Screenshot
const img = await page.screenshot({
type: 'png'
}); {
"message": [
"ReferenceError: Buffer is not defined"
],
"level": "error",
"timestamp": 1689948882582
},node_modules/@cloudflare/puppeteer/lib/esm/puppeteer/common/util.js:22:25: ERROR: Could not
resolve "node:stream"
node_modules/@cloudflare/puppeteer/lib/esm/puppeteer/common/util.js:23:23: ERROR: Could not
resolve "node:buffer"node_compat = true
nodejs_compat = truenode_compat = trueThe `nodejs_compat` compatibility flag cannot be used in conjunction with the legacy `--node-compat` flag. If you want to use the Workers runtime Node.js compatibility features, please remove the `--node-compat` argument from your CLI command or `node_compat = true` from your config file.compatibility_flags = [ "nodejs_compat" ]text: 'workers.api.error.no_access_to_browser_worker [code: 10088]'name = "open-graph"
main = "src/index.ts"
compatibility_date = "2023-07-21"
compatibility_flags = [ "nodejs_compat" ]
node_compat = true
workers_dev = true
browser = { binding = "MYBROSWER", type = "browser" } ⛅️ wrangler 3.3.0
------------------
▲ [WARNING] Enabling Node.js compatibility mode for built-ins and globals. This is experimental and has serious tradeoffs. Please see https://github.com/ionic-team/rollup-plugin-node-polyfills/ for more details.
✘ [ERROR] The `nodejs_compat` compatibility flag cannot be used in conjunction with the legacy `--node-compat` flag. If you want to use the Workers runtime Node.js compatibility features, please remove the `--node-compat` argument from your CLI command or `node_compat = true` from your config file.0.0.4"ReferenceError: Buffer is not defined"wrangler deployReferenceError: Buffer is not defined
at Page._Page_screenshotTask2 (index.js:7510:64) {
stack: ReferenceError: Buffer is not defined
at Page._Page_screenshotTask2 (index.js:7510:64),
message: Buffer is not defined
}✘ [ERROR] Could not resolve "node:buffer"
node_modules/@cloudflare/puppeteer/lib/esm/puppeteer/common/util.js:23:23:
23 │ import { Buffer } from 'node:buffer';
╵ ~~~~~~~~~~~~~
The package "node:buffer" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.
✘ [ERROR] Build failed with 2 errors:
node_modules/@cloudflare/puppeteer/lib/esm/puppeteer/common/util.js:22:25: ERROR: Could not
resolve "node:stream"
node_modules/@cloudflare/puppeteer/lib/esm/puppeteer/common/util.js:23:23: ERROR: Could not
resolve "node:buffer"import puppeteer from "@cloudflare/puppeteer";
import { Stream } from 'node:stream';
import { Buffer } from 'node:buffer';