cli icon indicating copy to clipboard operation
cli copied to clipboard

Existing project fails to build with recent CLI versions

Open fgsch opened this issue 3 years ago • 0 comments

Version

Fastly CLI version v4.0.1 (cc0afc7)
Built with go version go1.18.6 linux/amd64
Viceroy version: viceroy 0.2.15

What happened

Recent CLI versions expect the go.mod file to be in the same directory as the fastly.toml file. This was not the case until recently, and downgrading to e.g., 3.2.5 makes the project build again.

The error with recent versions:

$ fastly compute build  --non-interactive
Initializing...
Verifying package manifest...
Verifying local go toolchain...

ERROR: go.mod not found.

To fix this error, run the following command:

	$ go mod init

Then execute:

	$ fastly compute build

The repo structure:

.
├── go.mod
├── go.sum
├── service
│   └── main.go
│   └── fastly.toml
├── somepkg
│   └── somefile.go
│   └── someotherfile.go

fgsch avatar Oct 11 '22 13:10 fgsch