Yes, I am using @Cloudflare/next-on-pages with my project.
Yes, I am using @Cloudflare/next-on-pages with my project.
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.


functions/users/friends/index.ts will serve a request to /users/daniel/friends, in theory displaying a list of all the friends of daniel, but Im just getting the root app page instead of function output. Do I need to just use a [[catchall]].ts file at functions/users/[[catchall]].ts and handle all of the logic there, or am I doing something wrong?functions/users/index.ts file is working properly, and so is my functions/users/[user].ts file- index displays a list of users, and [user] displays the individual user matching the route param.performance.now() when in reality it wasn't related to it but actually happened beforeexport 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
}
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>,
) {
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
}