What versions & operating system are you using?
index.js
import { launch } from "@cloudflare/playwright";
export default {
async fetch(_request: Request, env: Env) {
const browser = await launch(env.BROWSER);
const page = await browser.newPage();
await page.goto("https://demo.playwright.dev/todomvc");
const TODO_ITEMS = ["buy some cheese", "feed the cat", "book a doctors appointment"];
const newTodo = page.getByPlaceholder("What needs to be done?");
for (const item of TODO_ITEMS) {
await newTodo.fill(item);
await newTodo.press("Enter");
}
const img = await page.screenshot();
await browser.close();
return new Response(img, {
headers: {
"Content-Type": "image/png",
},
});
},
};
wrangler.jsonc
Please provide a link to a minimal reproduction
https://github.com/cloudflare/cloudflare-docs/blob/production/src/content/docs/browser-rendering/platform/playwright.mdx
Describe the Bug
If you update the compatibility_date flag to 2025-09-17, it breaks the deployment:
Uncaught Error: No such module "node:fs".
imported from "index.js"
[code: 10021]
In order to fix the error you have two options:
- Set
compatibility_flags to nodejs_compat instead of nodejs_compat_v2
- Set
compatibility_date to an older date like 2025-06-30 instead of 2025-09-17
Please provide any relevant error logs
No response
What versions & operating system are you using?
index.js
wrangler.jsonc
Please provide a link to a minimal reproduction
https://github.com/cloudflare/cloudflare-docs/blob/production/src/content/docs/browser-rendering/platform/playwright.mdx
Describe the Bug
If you update the
compatibility_dateflag to2025-09-17, it breaks the deployment:In order to fix the error you have two options:
compatibility_flagstonodejs_compatinstead ofnodejs_compat_v2compatibility_dateto an older date like2025-06-30instead of2025-09-17Please provide any relevant error logs
No response