All guidesMore providers: databases, auth, hosting, email and payments
On this page

Vercel Python error

VercelFastAPI

No FastAPI entrypoint found in default locations

By Ohad Krispin, founder of VibeRaven · LinkedIn

"No FastAPI entrypoint found in default locations" is a Vercel build error. It means Vercel's Python builder found no file that defines a top-level variable named app holding a FastAPI instance, in app.py, index.py, server.py, main.py, wsgi.py or asgi.py at the project root or inside src/, app/ or api/. Rename the variable to app, move the file to one of those names, or point Vercel at your module with entrypoint = "backend.server:app" under [tool.vercel] in pyproject.toml. When the builder finds an app somewhere else in the repo, the message ends with the exact pyproject.toml lines to paste. Reproduced with @vercel/python 30.0.1 on 2026-10-31.

The three messages the Vercel Python builder prints

The text comes from packages/python/src/entrypoint.ts in the vercel/vercel repository, and the error code is FASTAPI_ENTRYPOINT_NOT_FOUND. Which message you get depends on what the builder found. A file with a valid name but no app variable gives the first one. An app in a file or folder outside the fixed locations gives the second, with a suggested line. No file at all gives the third, which lists every location it searched. In runs of @vercel/python 30.0.1 on 2026-10-31, a main.py that defined server = FastAPI(), a backend/server.py that defined app = FastAPI(), and a folder with only requirements.txt produced the three messages below, in that order.

Found main.py but it does not define a top-level "app" FastAPI instance.

No FastAPI entrypoint found in default locations, but found potential entrypoints:
  backend/server.py (variable: app)

Add this to your pyproject.toml:

[tool.vercel]
entrypoint = "backend.server:app"

No FastAPI entrypoint found. Set "tool.vercel.entrypoint" in pyproject.toml or define an entrypoint in one of: app.py, index.py, server.py, main.py, wsgi.py, asgi.py, src/app.py, ... api/asgi.py.

How do I point Vercel at a FastAPI app in a folder like backend/?

Set tool.vercel.entrypoint in pyproject.toml to module:variable. The Vercel FastAPI docs say this value tells Vercel to look for a FastAPI instance named app in ./backend/server.py. With this setting in place, the builder's detectEntrypoint function returned backend.server:app for the same layout.

[tool.vercel]
entrypoint = "backend.server:app"

Why does uvicorn run it locally but Vercel cannot find it?

Locally you give uvicorn the module and the variable yourself, for example uvicorn backend.server:api, so any file name and any variable name works. Vercel has no such argument. It looks for a FastAPI instance named app at its supported entrypoints, so a variable called api, server or fastapi_app is not found even in a file called main.py. If the project also has an api/ folder, Vercel's docs say a detected Python framework preset takes precedence over file-based functions, so the FastAPI app handles all requests and the files under /api do not become separate functions.

Checklist

How to fix it, then check the fix

  1. 01
    Find where the app is created and what the variable is called:
    grep -rnE "FastAPI\(" --include=*.py --exclude-dir=.venv --exclude-dir=node_modules .
  2. 02If the variable is not called app, rename it, or add a line such as app = api under it. Vercel needs the top-level name app for FastAPI.
  3. 03Keep the file at one of the supported names and places: app.py, index.py, server.py, main.py, wsgi.py or asgi.py at the project root or inside src/, app/ or api/. If it lives elsewhere, add [tool.vercel] entrypoint = "folder.module:app" to pyproject.toml.
  4. 04
    Run it the way Vercel does. The docs ask for Vercel CLI 48.1.8 or newer:
    python -m venv .venv
    source .venv/bin/activate
    pip install -r requirements.txt
    vercel dev
  5. 05Push and read the build log. The FASTAPI_ENTRYPOINT_NOT_FOUND message should be gone, and a route you defined, such as /, should answer from the deployment URL.

Related

Sources

Official docs behind this checklist

FAQ

FAQ for builders before launch

Does the file have to be called main.py?

No. Vercel looks for app.py, index.py, server.py, main.py, wsgi.py or asgi.py, at the project root or inside src/, app/ or api/ (the builder source lists all four). Any other name needs tool.vercel.entrypoint in pyproject.toml.

Does the same rule apply to Flask?

Yes, with a different object. The Python runtime docs say the entrypoint file must define app for most ASGI or WSGI frameworks, including FastAPI and Flask, and application for Django and other WSGI applications.

Where does my Python app read dependencies from?

From pyproject.toml, requirements.txt or a Pipfile, found next to the entrypoint or in a folder above it. A package missing from that file shows up later, at runtime, as ModuleNotFoundError, not as this build error.