bug(web): DELETE conversation fails with "Failed to fetch" TypeError #195
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
Attempting to delete a conversation via the web dashboard fails with a
TypeError: Failed to fetchat the network level. The request never completes — this is not a server-side error but a client-side fetch failure.Error
Location
apps/web/src/lib/api.ts:28—fetch()call failsapps/web/src/app/(dashboard)/chat/page.tsx:154—handleDeletecallsapi<void>(\/api/conversations/${id}`, { method: 'DELETE' })`apps/gateway/src/conversations/conversations.controller.ts:67—@Delete(':id')endpoint exists and returns 204Analysis
Failed to fetchis a browser-level network error, not an HTTP error. The request does not reach the server. Likely causes:CORS preflight failure on DELETE —
DELETEis not a simple method, so the browser sends anOPTIONSpreflight request. The gateway CORS config (enableCors({ origin, credentials })) uses Fastify's CORS plugin which should handle this, but verify:@fastify/corsproperly handlingOPTIONSpreflight forDELETEmethod?Access-Control-Allow-Methodsresponse header includingDELETE?Mixed content / URL mismatch — If the web app runs on a different origin than
http://localhost:3000(e.g., HTTPS, different port, or a real domain), the CORS origin check will reject it.GATEWAY_CORS_ORIGINis set tohttp://localhost:3000in.env.Gateway not running — The simplest cause. If the gateway is down, all fetches fail with this error.
Related
This may share a root cause with #191 (sidebar delete in TUI also fails). Both attempt
DELETE /api/conversations/:id— if the endpoint itself is broken, both clients would fail.Steps to Reproduce
http://localhost:3000Environment
http://localhost:3000