I had same errors after deployment with python backend, nextjs frontend. I tried with fastapi, now using a flask template.
My issue was missing absolute path.
Use absolute paths--> from api.calculator. beforehand I used .calculator which works when deployed but not local and calculator which worked local but not when deployed.
In deployments in Vercel you can see logs. Here is my skeleton structure now for index.py
from flask import Flask, request, jsonify from api.calculator import Calculator from flask_cors import CORS
app = Flask(name) CORS(app)