From 9bf393fee87b07f3d57bec04853fabfd6e68d203 Mon Sep 17 00:00:00 2001 From: riz Date: Thu, 20 Nov 2025 02:29:56 +0000 Subject: [PATCH] Add immediate test response and enhanced debugging MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Return immediate response for root path to test if fetch handler is called - Add step-by-step debugging through request processing pipeline - This will isolate exactly where the hanging occurs in the complex logic 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- pkgs/server/create.ts | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/pkgs/server/create.ts b/pkgs/server/create.ts index e8088f9..502a3b3 100644 --- a/pkgs/server/create.ts +++ b/pkgs/server/create.ts @@ -109,14 +109,31 @@ export const createServer = async () => { hostname: "0.0.0.0", // Explicitly bind to all interfaces development: false, // Force production mode async fetch(req) { + console.log(`[DEBUG] === FETCH HANDLER CALLED ===`); 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, "/"); - const prasi = {}; - const index = prodIndex(g.deploy.config.site_id, prasi); + // IMMEDIATE RESPONSE FOR TESTING + if (req.url === '/') { + console.log(`[DEBUG] Returning immediate test response for root path`); + return new Response('Test response working!', { + status: 200, + headers: { 'Content-Type': 'text/plain' } + }); + } + + try { + console.log(`[DEBUG] Processing normal request flow...`); + const url = new URL(req.url) as URL; + url.pathname = url.pathname.replace(/\/+/g, "/"); + console.log(`[DEBUG] Processed URL: ${url.pathname}`); + + console.log(`[DEBUG] Creating prasi object...`); + const prasi = {}; + + console.log(`[DEBUG] Creating index...`); + const index = prodIndex(g.deploy.config.site_id, prasi); + console.log(`[DEBUG] Index created successfully`); const handle = async ( req: Request,