Only if you have a tail session/logpush job running
Only if you have a tail session/logpush job running
wrangler tail overnight and hope for the bestwhile true; do wrangler tail; end ? Error: Trace resource limit exceeded; subsequent exceptions not recorded. before?wrangler tailwhile true; do wrangler tail; end[[r2_buckets]]
binding = 'MY_BUCKET' # <~ valid JavaScript variable name
bucket_name = '<test_bucket>'
preview_bucket_name = '<test_bucket>'└────────────────────────────────────┴──────────────────────────────────┘
🔓 Token Permissions: If scopes are missing, you may need to logout and re-login.
Scope (Access)
- account (read)
- user (read)
- workers (write)
- workers_kv (write)
- workers_routes (write)
- workers_scripts (write)
- workers_tail (read)
- d1 (write)
- pages (write)
- zone (read)
- ssl_certs (write)
- constellation (write)
- ai (read)
- offline_access import { json } from "@remix-run/react";
export const loader: LoaderFunction = async ({ request, context, params }) => {
const url = new URL(request.url);
const cacheKey = new Request(url.toString(), request);
const cache = context.cloudflare.caches.default;
const cacheEntry = await cache.match(cacheKey);
let users = (await cacheEntry?.json())?.users;
if (!users) {
const query = url.searchParams.get("query");
const db = await context.db;
users = await db.query(query);
context.cloudflare.ctx.waitUntil(
cache.put(
cacheKey,
json(users, {
headers: {
Expires: new Date(
new Date().setFullYear(new Date().getFullYear() + 1),
).toUTCString(),
},
}),
),
);
}
...
}// So you can write this:
return json({ any: "thing" });
// Instead of this:
return new Response(JSON.stringify({ any: "thing" }), {
headers: {
"Content-Type": "application/json; charset=utf-8",
},
});Error: Trace resource limit exceeded; subsequent exceptions not recorded.