Must have a valid version, for example `now-php@1.0.0`

I have no clue why this happens. But my build logs of a FastAPI project shows this message:

Error: Function Runtimes must have a valid version, for example now-php@1.0.0.

and fail then.
Using find and grep, i can clearly state that there is NOWHERE any now-php inside my python project.

v0 told me, it must be a vercel platform bug. Anyone faced this as well?

my vercel.json looks like this

{
  "functions": {
    "app/api/hello.py": {
      "runtime": "python@3.9"
    },
    "app/api/vercel.py": {
      "runtime": "python@3.9"
    }
  },
  "routes": [
    {
      "src": "/api/(.*)",
      "dest": "/app/api/vercel.py"
    },
    {
      "src": "/(.*)",
      "dest": "/app/api/vercel.py"
    }
  ]
}

Make sure you have Node 18 selected in your Project Settings to use python@3.9. If you have it deployed on Node 20 or later, it will not work as Python 3.9 uses legacy build image: Using the Python Runtime with Vercel Functions

We are deprecating Node 18 next month

python 3.9 is indeed too old, as i use 3.12. But v0 told me to use 3.9 instead of 3.12 although vercel docs say the opposite. However, this has nothing to do with node or something like that. It is pure python.

Even though you aren’t using Node in your application, the Node version matters to deploy in our build system. This means you need to make sure Node version is set to Node 20+ in order to use Python 3.12

If you are using Python 3.9, you need to make sure Node version is set to 18.x in your project.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.