Issues when invoking go functions locally #10941
Replies: 4 comments 1 reply
-
bump, same issue here |
Beta Was this translation helpful? Give feedback.
-
has this been resolved yet? |
Beta Was this translation helpful? Give feedback.
-
how to fix? |
Beta Was this translation helpful? Give feedback.
-
I have the same issue, and I tried to make this works. Possible causeIt seems the error message shows because there is no go version set in > cat .vercel/cache/go/r80oal2j1qg/go.work
use (
.
)
> cd .vercel/cache/go/r80oal2j1qg/
> go build -o ./vencel-dev-server-go ./...
go: module . listed in go.work file requires go >= 1.21, but go.work lists go 1.18; to update it:
go work use And when I added the go version in go.work, it worked > grep 'go 1.2' go.mod
go 1.21
> sed -i'' -e '1 i go 1.21' go.work
> cat go.work
go 1.21
use (
.
)
> go build -o ./vencel-dev-server-go ./...
> ls
api go.mod go.work go.work.sum vencel-dev-server-go
> ./vencel-dev-server-go
2024/04/28 17:08:56 /home/michael/src/nooxac/go/nooxac-gateway/pkg/db/client.go:74
[error] failed to initialize database, got error dial tcp 127.0.0.1:3306: connect: connection refused Possible fixI couldn't find a workaround, but adding the go.version in Hope it helps the owner of this repository to look into an error and fix an issue faster. By the way, I also see there are a few questions that are similar to this such as followings, so I'm sorry if this isn't the good place.
|
Beta Was this translation helpful? Give feedback.
-
Question
Summary
I have serverless functions set up for vercel deployment.
I have no go.work set up.Just go.mod, and no problem working when deployed.
However if I run on vercel dev I get below message as I am invoking the function.
go mod inside the .vercel/cache folder
Example
No response
Steps to Reproduce
vercel dev
Beta Was this translation helpful? Give feedback.
All reactions