Internal Server Error 500 - python function in nextjs app - Help

I’m currently using the Next.js FastAPI starter combined with the AI SDK Python streaming templates from Vercel to deploy my app. The deployed application is available at:
https://ingredient-analyzer-nextjs-740pcatap-funnylabs.vercel.app/

The code is publicly available on GitHub at:

Issue:
When calling the Python API endpoint, I’m receiving a 500 Internal Server Error. I’ve verified the following:

  • Next.js configuration
  • package.json settings
  • POST API definition
  • Rewrites

Despite 12 iterations of troubleshooting over the past 5 days, the error persists.

Steps to Reproduce:

  1. Open the deployed app: https://ingredient-analyzer-nextjs-740pcatap-funnylabs.vercel.app/
  2. Upload an image.
  3. Click the button designated for processing.
  4. Click the “Export PDF” button. (Note: The PDF export functionality is implemented in Python, and the relevant code is located in the /api/ folder of the GitHub repository.)

Request for Assistance:
I require help identifying and fixing the issue causing the 500 internal server error when the Python API endpoint is triggered.

Any insights, suggestions, or debugging tips would be greatly appreciated!

Hi @verceluntimed749-slm, welcome to the Vercel Community!

Sorry that you are facing this issue. I see you shared a lot about the project but can you also share here the runtime error logs.

What happens when you run this project locally?