vercel: [Bug] Vercel failed to build go serverless functions with go >= 1.21
Currently, vercel fails to build any golang serverless functions when using go1.21 or later, it outputs:
go: module . listed in go.work file requires go >= 1.21, but go.work lists go 1.18; to update it:
go work use
go: module ../../../.. listed in go.work file requires go >= 1.21, but go.work lists go 1.18; to update it:
go work use
Error: Command failed: go build -ldflags -s -w -o ./vercel-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
go: module ../../../.. listed in go.work file requires go >= 1.21, but go.work lists go 1.18; to update it:
go work use
Error: Command failed: go build -ldflags -s -w -o ./vercel-dev-server-go ./...
I believe it’s caused by vercel’s go.work generation here:
where it should include the go directive (e.g. go 1.21.0) at the top of the generated go.work file.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 19 (9 by maintainers)
Commits related to this issue
- [cli] fix missing go directive of go.work (#11976) — committed to wayjam/vercel by wayjam 2 years ago
- [cli] fix missing go directive of go.work (#11976) — committed to wayjam/vercel by wayjam 2 years ago
- [cli] fix missing go directive of go.work (#11976) — committed to wayjam/vercel by wayjam 2 years ago
- Go work missing go version declaration in dev mode (#12574) The go.work file used on `vercel dev` is missing the go version declaration causing 502 errors on functions in dev that work as expected in... — committed to vercel/vercel by eprosimon 2 years ago
- Go work missing go version declaration in dev mode (#12574) The go.work file used on `vercel dev` is missing the go version declaration causing 502 errors on functions in dev that work as expected in... — committed to QuietCraftsmanship/Vercel by eprosimon 2 years ago
vercel@39.0.3 does not yet does not yet contain the fix, so it would need to be the next release after that number. @DavidChouinard please keep an eye out for that. @jeffreywescott Could you also attempt the next release on your workload. @StefMa I would Ideally prefer 2 independent tests before we close, If there are any specific issues that anyone has I would like to add additional test cases.
I can report back that
vercel devworks again. I tested it with this project and this branch.vercel cli version used:
39.1.0go version:1.23.3Yes – I’ll keep an eye out for a new release here and then give it a whirl!
Looks like that PR got merged, and I’m on the latest version, but still getting this error when using
vercel devlocally.Nope, doesn’t help
oh yep, it looks like a local issue with
vercel dev👀