API & Service Errors
This page covers common API, email, and file upload errors in TurboStack.Validation Errors
VALIDATION_ERROR with JSON Message
Error Message:Cause
Elysia’s validation errors return detailed JSON objects. The error handler needs to parse these into user-friendly messages.Solution
The global error handler inapps/backend/src/index.ts should format validation errors:
Frontend Handling
Email Errors
Emails Not Sending
Symptoms:- No emails received
- No errors in console
- API returns success
Cause
RESEND_API_KEYnot configured- Email service calls using
voidinstead ofawait - Email sending silently failing
Solution
Step 1: Check environment variable:Resend Rate Limits
Error Message:- Free tier: 100 emails/day, 1 email/second
- Check your Resend dashboard for usage
- Implement email queuing for bulk sends
File Upload Errors
UploadThing Token Missing
Error Message:Solution
Add your UploadThing token to.env:
File Too Large
Error Message:Cause
Uploaded file exceeds the configured size limit.Solution
Adjust limit in route:Invalid File Type
Error Message:Solution
Backend validation:CORS Errors
Error Message
Cause
Backend CORS configuration doesn’t allow requests from frontend origin.Solution
Check CORS configuration:.env:
Network Errors
Failed to Connect to Server
Error Message:Cause
- Backend server is not running
- Wrong API URL configured
- Network connectivity issues
Solution
Check if backend is running:404 Not Found Errors
API Route Not Found
Error Message:Cause
- Route doesn’t exist
- Wrong HTTP method
- Route prefix mismatch