I’m having the same issue for a Go project deployed to Vercel.
The same deployment that worked a few days ago can no longer be redeployed successfully.
After redeploying, I get the following panic:
1panic: no such file or directory2goroutine 1 [running]:3main.checkForLambdaWrapper()4./main__vc__go__.go:24 +0x14a5main.main()6./main__vc__go__.go:29 +0x13
So I checked the vercel code, and it looks like Vercel is injecting the AWS_LAMBDA_EXEC_WRAPPER environment variable into the Lambda runtime. My app tries to execute whatever path is provided by this variable, but it points to a file that does not exist in the execution environment, which causes the panic. 🤔
Code: https://github.com/vercel/vercel/blob/74edeef49a3b51441fe61fcc2323260af6902a16/packages/go/main.go#L12-L26
1func checkForLambdaWrapper() {2 wrapper := os.Getenv("AWS_LAMBDA_EXEC_WRAPPER")3 if wrapper == "" {4 return5 }67 // Removing the env var doesn't work8 // Set it to empty string to override the previous value9 os.Setenv("AWS_LAMBDA_EXEC_WRAPPER", "")10 argv := append([]string{wrapper}, os.Args...)11 err := syscall.Exec(wrapper, argv, os.Environ())12 if err != nil {13 panic(err)14 }15}