Cloudflare & Sveltekit issue: when refresh a dynamic page throws 500 Internal error

I have created a small restaurant menu application. Deployed on CLOUDFLARE and using POCKETBASE for data storage. For the first time visit there is no problem. But when I refresh the page it throws a 500 Internal Error. Does anyone face this issue? and if you know please help me to solve the issue. Thank you! Here is the link: https://restro-public.pages.dev/zsh67hbt8rig8o7
Urban | Table-side Ordering SAAS
Urban saas is a table side ordering system built for restaurants, cafe, food court etc.
6 Replies
Walshy
Walshy3w ago
?pages-logs
SuperHelpflare
If you're looking to tail a Pages Function you can do so in the UI here: https://dash.cloudflare.com?to=/:account/pages/view/:pages-project/:pages-deployment/functions or with Wrangler: wrangler pages deployment tail [deploymentId/url]
Walshy
Walshy3w ago
Check the logs and see what they say ^
Mehedi
MehediOP3w ago
Here is the server logs: https://jsonblob.com/1328292368818036736 @Walshy | Workers/Pages
JSON Blob | 1328292368818036736
JSON Blob is a web-based tool to create, edit, view, format, and share JSON. It shows your JSON side by side in a clear, editable tree-view and in formatted plain text. You can save your JSON and share it via URL with anyone
Walshy
Walshy3w ago
So the error is: Error: Cannot perform I/O on behalf of a different request. I/O objects (such as streams, request/response bodies, and others) created in the context of one request handler cannot be accessed from a different request's handler. This is a limitation of Cloudflare Workers which allows us to improve overall performance. (I/O type: RefcountedCanceler)
Mehedi
MehediOP3w ago
so how should i solve this error?? this is my server code: +page.server.ts
import { pb } from '$lib/db';
import type { PageServerLoad } from './$types';
export const load = (async ({ params }) => {
const records = await pb.collection('menus').getFullList({
filter: `restaurant_id = "${params.restaurant_id}" && is_available = true`
});
return { records }; // This records come from pocketbase query
}) satisfies PageServerLoad;
import { pb } from '$lib/db';
import type { PageServerLoad } from './$types';
export const load = (async ({ params }) => {
const records = await pb.collection('menus').getFullList({
filter: `restaurant_id = "${params.restaurant_id}" && is_available = true`
});
return { records }; // This records come from pocketbase query
}) satisfies PageServerLoad;

Did you find this page helpful?