Vercel + Go version number required issue

Hi! I am running into a runtime error when I tried to import go. I’ve been trying to follow the documentation at Using the Go Runtime with Vercel functions but I can’t seem to get past this error:
“Error: Function Runtimes must have a valid version, for example now-php@1.0.0.”

vercel.json
{
  "functions": {
    "api/cards.go": {
      "runtime": "go"
    },
    "api/decks.go": {
      "runtime": "go"
    },
    "api/study.go": {
      "runtime": "go"
    },
    "api/review.go": {
      "runtime": "go"
    }
  },
  "routes": [
    {
      "src": "/api/(.*)",
      "dest": "/api/$1"
    },
    {
      "src": "/(.*)",
      "dest": "/static/$1"
    }
  ]
Let me know if you have any other questions.I tried several iterations with numbers but couldn't seem to get it working 😞thanks for your help!

Any help i can get here please?

Hi, @blucreatr! Welcome to the Vercel Community.

I believe that you need to specify the Go runtime version in your vercel.json configuration file. The error indicates that Vercel requires an explicit version number for the Go runtime.

Could you try the following:

{   "functions": {     "api/*.go": {       "runtime": "go1.x"     }   } }

The go1.x runtime will automatically use the latest supported Go version. Make sure your Go files are placed in the api/ directory and follow the proper function format as shown in the documentation.

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