When making SQLite calls via https://esm.town/v/std/sqlite after a long-running operation (like an AI call), the request fails with:
Error: {"statusCode":500,"error":"Internal Server Error","message":"fetch failed"}
The SQLite "fetch failed" error occurs when:
https://esm.town/v/std/sqlitedcm31/github-leads-wizardThe SQLite INSERT should succeed regardless of how long the request has been running.
After a delay (simulating AI processing), the SQLite call fails with:
{"statusCode":500,"error":"Internal Server Error","message":"fetch failed"}
at createResError (https://esm.town/v/std/sqlite?v=6:81:10)
at Object.execute (https://esm.town/v/std/sqlite?v=6:47:11)
at eventLoopTick (ext:core/01_core.js:179:7)
at async createSession (https://esm.town/v/dcm31/github-leads-wizard@103-main/db.ts:40:3)
at async Array.<anonymous> (https://esm.town/v/dcm31/github-leads-wizard@103-main/main.ts:140:23)
In the github-leads-wizard val:
/api/startgeneratePrompt() calls AI (takes 30-120+ seconds)createSession() is called which does an SQLite INSERTFor programmatic testing:
curl -X POST https://dcm31--32c77ddefb9811f0be9942dde27851f2.web.val.run/api/test \ -H "Content-Type: application/json" \ -d '{"delay": 30000}'