Can't run "vercel dev" with python backend

This is seems to be the same as Local Python Runtime `vercel dev`

I have a project with FastAPI python backend, forked from Next.js FastAPI Starter

Everything works fine except “vercel dev”.
With a default versel.json :

  "functions": {
    "api/**": {
      "excludeFiles": "{.next,.git,node_modules}/**"
    }
  },

It just doesn’t run python functions at all. All logs look successfull, but then there is just backend available.

vercel dev
Vercel CLI 42.3.0
> Running Dev Command “next dev --port $PORT”
- ready started server on 0.0.0.0:3000, url: http://localhost:3000
> Ready! Available at http://localhost:3000
- info Loaded env from /Users/sinavski/projects/hello_world_website/.env.local
- info Loaded env from /Users/sinavski/projects/hello_world_website/.env
- event compiled client and server successfully in 2.6s (313 modules)
- wait compiling...
- event compiled client and server successfully in 1142 ms (313 modules)

The client can’t hit any of APIs:

Failed to load resource: the server responded with a status of 404 (Not Found)

I tried adding python runtime into functions:

  "functions": {
    "api/index.py": {
      "runtime": "vercel-python@3.12.0"
    },
    "api/**": {
      "excludeFiles": "{.next,.git,node_modules}/**"
    }
  },

I tried:

  • python, vercel/python, vercel-python - all sorts of errors with non-found npm python package
  • no minor version → Error: Function Runtimes must have a valid version, for example now-php@1.0.0.

There’s another community post with 404 debugging tips that might be helpful. Please give these solutions a try and let us know how it goes.

A human should be around soon to offer more advice. But you can also get helpful information quickly by asking v0.