Public
Likesqlite-fetch-failed-repro
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Viewing readonly version of main branch: v7View latest version
When making SQLite calls via https://esm.town/v/std/sqlite, occasionally the request fails with:
Error: {"statusCode":500,"error":"Internal Server Error","message":"fetch failed"}
- Platform: Val Town
- SQLite Library:
https://esm.town/v/std/sqlite - Original val:
dcm31/github-leads-wizard
- Open the HTTP endpoint for
main.tsin this val - Make a POST request to trigger the SQLite INSERT
- Observe the response
The SQLite INSERT should succeed and return { ok: true, id: "..." }
Sometimes returns:
{ "error": "{\"statusCode\":500,\"error\":\"Internal Server Error\",\"message\":\"fetch failed\"}" }
With stack trace:
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)
This error occurred in the github-leads-wizard val when:
- User submits a company to analyze
createSession()is called which does an SQLite INSERT- The INSERT fails with the fetch error
- This blocks the email results flow
See main.ts - it contains the minimal code to reproduce: just an HTTP endpoint that does a single SQLite INSERT.
- This appears to be a transient error (not always reproducible)
- May be related to cold starts or network timeouts
- The original code worked previously, suggesting infrastructure issue