smart placement is pretty broken with Pages in general at the moment
smart placement is pretty broken with Pages in general at the moment
XXX ms in lab conditions even on cache hits (where in a plain worker we see XX ms_. Then we realized it wasn't KV but rather the first IO we had (and with the CF Workers security measures, we understand we could be measuring things before that I/O that just wait for the I/O to tick?)

Hacker News
•4/4/21, 3:47 PM

x-vercel-* or cf-* headers was triggering this. The headers were coming from next/headers and may have gotten mixed around by all the trpc context switching going on in the T3stack boilerplate. If anyone runs into this I just wrote code to strip any of those headers being sent on UI requestsnpm run dev (idk if npx wrangler dev is the right command, if so I'm running into a bunch of 500 errors that I really can't figure out)wrangler dev is the right command this is the error I'm getting:wrangler pages dev insteadnode-compat somewhere?npx wrangler pages dev .vercel/output/static --compatibility-flag=nodejs_compatnpx wrangler pages deployment tailconst t0 = Date.now();
const data = env.KV.get(key);
const t1 = Date.now();XXX msXX msx-vercel-*cf-*"exceptions": [
{
"name": "Error",
"message": "The script will never generate a response.",
"timestamp": 1711296914762
}
],npx wrangler dev[wrangler:inf] Ready on http://localhost:8787
[wrangler:err] TypeError: Cannot read properties of undefined (reading 'fetch')
at Object.fetch (file:///Volumes/[...]/.vercel/output/static/_worker.js/index.js:40:40336)node_modules/wrangler/wrangler-dist/cli.js:29573
throw a;
^
MiniflareCoreError [ERR_RUNTIME_FAILURE]: The Workers runtime failed to start. There is likely additional logging output above.node-compatnpx wrangler pages dev .vercel/output/static --compatibility-flag=nodejs_compat✘ [ERROR] Your worker created multiple branches of a single stream (for instance, by calling `response.clone()` or `request.clone()`) but did not read the body of both branches. This is wasteful, as it forces the system to buffer the entire stream of data in memory, rather than streaming it through. This may cause your worker to be unexpectedly terminated for going over the memory limit. If you only meant to copy the request or response headers and metadata (e.g. in order to be able to modify them), use the appropriate constructors instead (for instance, `new Response(response.body, response)`, `new Request(request)`, etc).npx wrangler pages deployment tailSuccessfully logged in.
Expired! Auth code or refresh token needs to be renewed.
/Volumes/Primary/Code/cms/node_modules/wrangler/wrangler-dist/cli.js:29573
throw a;
^
ErrorInvalidGrant