This document contains all common issues encountered during development and their solutions.
Solution:
- Create a
.envfile in the root directory - Add your inference API credentials:
INFERENCE_API_ENDPOINT=https://your-api-endpoint.com/deployment INFERENCE_API_TOKEN=your-pre-generated-token-here INFERENCE_MODEL_NAME=codellama/CodeLlama-34b-Instruct-hf - Restart the server
Solution:
- The limit exists due to model context window constraints
- CodeLlama-34b on Enterprise Inference has a max token limit of 5196
- 4000 characters stays safely under the token limit including prompt overhead
- Break your code into smaller modules
- Translate one class or function at a time
- Or adjust
MAX_CODE_LENGTHin.envif your deployment supports higher limits
Solution:
- Only 6 languages are supported: Java, C, C++, Python, Rust, Go
- Check the
/languagesendpoint for the current list - Ensure language names are lowercase (e.g., "python" not "Python")
Solution:
- Ensure all dependencies are installed:
pip install -r requirements.txt - Verify you're using Python 3.10 or higher:
python --version - Activate your virtual environment if using one
Solution:
- Check if port 5001 is already in use:
lsof -i :5001(Unix) ornetstat -ano | findstr :5001(Windows) - Use a different port by updating
BACKEND_PORTin.env - Check the logs for specific error messages
Solution:
- Verify the file is a valid PDF
- Check file size (must be under 10MB by default)
- Ensure the PDF contains extractable text (not just images)
- Check server logs for detailed error messages
Solution:
- Verify inference API authentication is working (check
/healthendpoint) - Check if the model endpoint is accessible
- Verify INFERENCE_API_TOKEN is valid and not expired
- Try with simpler code first
- Check server logs for API errors
Solution:
pip install pypdfProblem: "Failed to translate" or "Failed to upload PDF"
Solution:
- Ensure the API server is running on
http://localhost:5001 - Check browser console for detailed errors
- Verify CORS is enabled in the API
- Test API directly:
curl http://localhost:5001/health
Problem: Build fails with dependency errors
Solution:
# Clear node_modules and reinstall
rm -rf node_modules package-lock.json
npm installProblem: Styles not applying
Solution:
# Rebuild Tailwind CSS
npm run devProblem: Character counter shows 0 / 4,000 even with code
Solution:
- Clear browser cache
- Hard refresh (Ctrl+Shift+R or Cmd+Shift+R)
- Restart the dev server