Add comprehensive request debugging to isolate hanging
- Log every incoming request with method, URL, and headers - Add try-catch around entire fetch handler with stack traces - Force development mode to false for production behavior - This will show exactly where requests are failing or hanging 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
+14
-2
@@ -87,8 +87,12 @@ export const createServer = async () => {
|
|||||||
port: g.port,
|
port: g.port,
|
||||||
maxRequestBodySize: 1024 * 1024 * 128,
|
maxRequestBodySize: 1024 * 1024 * 128,
|
||||||
hostname: "0.0.0.0", // Explicitly bind to all interfaces
|
hostname: "0.0.0.0", // Explicitly bind to all interfaces
|
||||||
|
development: false, // Force production mode
|
||||||
async fetch(req) {
|
async fetch(req) {
|
||||||
const url = new URL(req.url) as URL;
|
console.log(`[DEBUG] Request received: ${req.method} ${req.url}`);
|
||||||
|
console.log(`[DEBUG] Request headers:`, Object.fromEntries(req.headers.entries()));
|
||||||
|
try {
|
||||||
|
const url = new URL(req.url) as URL;
|
||||||
url.pathname = url.pathname.replace(/\/+/g, "/");
|
url.pathname = url.pathname.replace(/\/+/g, "/");
|
||||||
|
|
||||||
const prasi = {};
|
const prasi = {};
|
||||||
@@ -185,7 +189,15 @@ export const createServer = async () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return handle(req);
|
return handle(req);
|
||||||
|
} catch (fetchError) {
|
||||||
|
console.error(`[ERROR] Fetch handler error:`, fetchError);
|
||||||
|
console.error(`[ERROR] Stack trace:`, fetchError.stack);
|
||||||
|
return new Response(`Fetch Handler Error: ${fetchError.message}`, {
|
||||||
|
status: 500,
|
||||||
|
statusText: "Internal Server Error",
|
||||||
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
error(error) {
|
error(error) {
|
||||||
console.error(`[ERROR] Server error:`, error);
|
console.error(`[ERROR] Server error:`, error);
|
||||||
|
|||||||
Reference in New Issue
Block a user