Vercel FastAPI: эта бессерверная функция дала сбой [закрыто]Python

Программы на Python
Anonymous
 Vercel FastAPI: эта бессерверная функция дала сбой [закрыто]

Сообщение Anonymous »

Я развернул FastAPI на Vercel, но при подключении к конечной точке происходит сбой
Я вставил vercel.json и журналы ошибок ниже
Ниже приведена конфигурация vercel.json
{
"version": 2,
"functions": {
"api/index.py": {
"runtime": "@vercel/python@4.3.0"
}
},
"routes": [
{
"handle": "filesystem"
},
{
"src": "/api/.*",
"dest": "/api/index.py"
},
{
"src": "/(.*)",
"dest": "/public/$1"
}
],
"env": {
"PYTHONUNBUFFERED": "1"
}
}

Ниже приведен журнал, созданный на Vercel
[WARNING] 2025-10-22T08:53:37.387Z LAMBDA_WARNING: Unhandled exception. The most likely cause is an issue in the function code. However, in rare cases, a Lambda runtime update can cause unexpected function behavior. For functions using managed runtimes, runtime updates can be triggered by a function change, or can be applied automatically. To determine if the runtime has been updated, check the runtime version in the INIT_START log entry. If this error correlates with a change in the runtime version, you may be able to mitigate this error by temporarily rolling back to the previous runtime version. For more information, see https://docs.aws.amazon.com/lambda/late ... pdate.html
[ERROR] TypeError: issubclass() arg 1 must be a class
Traceback (most recent call last):
File "/var/lang/lib/python3.12/importlib/__init__.py", line 90, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1387, in _gcd_import
File "", line 1360, in _find_and_load
File "", line 1331, in _find_and_load_unlocked
File "", line 935, in _load_unlocked
File "", line 999, in exec_module
File "", line 488, in _call_with_frames_removed
File "/var/task/vc__handler__python.py", line 32, in
if not issubclass(base, BaseHTTPRequestHandler):


Подробнее здесь: https://stackoverflow.com/questions/797 ... as-crashed

Вернуться в «Python»