fastly/cli

--file option of fastly compute serve looks like it's ignored

Closed this issue · 2 comments

Version

36a4ce4

What happened

$ fastly compute serve --file=zig-out/bin/package.wasm

ERROR: error creating package archive: error copying file: cannot read source file: ./bin/main.wasm.

This is confusing and feels like the --file option is ignored and ./bin/main.wasm is hard-coded.

It works if the --skip-build option is also present, though.

This looks like a bug.

https://github.com/fastly/cli/blob/main/pkg%2Fcommands%2Fcompute%2Fbuild.go#L295

It references a constant when it should use the flag value.

The workaround, as you've noted, is to skip the build entirely.

I'll work on a fix tomorrow.

Awesome, thank you!