👋 I have a NuxtJS project hosted on Cloudflare Pages. I have the need for an advanced mode Worker f
I've tried the root of the repo and putting it into public. Neither work.
[Object object] response instead of doing the SSE thing.fetch handler.fetch handler generated internally by Pages.crypto in my vite.ssr.externals, then it doesn't error on build but then says the export is missing when I try to use it.MiniflareCoreError [ERR_FUTURE_COMPATIBILITY_DATE]: Compatibility date "2024-09-23" is in the future and unsupported when running 'npx wrangler pages dev ./dist --compatibility-date=2024-09-23'nodejs_compat_V2nodejs_compat flag
npm run preview and I try to hit that endpoint using the server URL I just get a 404 error. Where am I going wrong here? total timing from the Worker is 284 ms while Waiting for server response from the DevTools is at 885 ms—more than 3 times slower.total:
Fetch started eventTimestamp onRequest start onRequest end Fetch finished = simply eventTimestamp
Worker execution = onRequest start - onRequest end
Cloudflare -> Client = Fetch finished - onRequest end
You can see that the most amount of time is actually spent on the way from the worker to the client.
There could be a mistake where the measured Worker end time is not correct since the Date.now` only advances on I/O in workerd. I'll test this a bit later.

[Object object]Cannot bundle Node.js built-in "crypto" imported from "../node_modules/oauth/lib/oauth.js". Consider disabling ssr.noExternal or remove the built-in dependency.cryptovite.ssr.externals[commonjs--resolver] [plugin vite:resolve] Cannot bundle Node.js built-in "util" imported from "../node_modules/knex/lib/dialects/sqlite3/index.js". Consider disabling ssr.noExternal or remove the built-in dependency.MiniflareCoreError [ERR_FUTURE_COMPATIBILITY_DATE]: Compatibility date "2024-09-23" is in the future and unsupportednodejs_compat_V2nodejs_compatnpm run previewtotaltotalWaiting for server responseFetch startedeventTimestamponRequest startonRequest endFetch finished = simply
= = - -
You can see that the most amount of time is actually spent on the way from the worker to the client.
There could be a mistake where the measured Worker end time is not correct since the export async function onRequest(
context: EventContext<unknown, string, unknown>,
) {
const start = performance.now()
const response = await createPagesFunctionHandler({ build, getLoadContext })(
context,
)
const end = performance.now()
response.headers.append("Server-Timing", `total;dur=${end - start}`)
return response
}export async function onRequest(
context: EventContext<unknown, string, unknown>,
) {
console.log("onRequest start", new Date().toISOString())
const response = await createPagesFunctionHandler({ build, getLoadContext })(
context,
)
await fetch("https://httpbin.org/get")
console.log("onRequest end", new Date().toISOString())
return response
}