Cannot build szkiba/xk6-dotenv@latest

not possible to install this extension.
$ xk6 build --with github.com/szkiba/xk6-dotenv@latest → 2023/12/05 14:33:48 [FATAL] exit status 2

Hi @vlatko606

I cannot reproduce this on my laptop, so I suspect it will have something to do with the steps you follow or the versions.

Running with docker, it worked for me (see Build a k6 binary using Docker | Grafana k6 documentation):

docker run --rm -e GOOS=darwin -u "$(id -u):$(id -g)" -v "${PWD}:/xk6" \
  grafana/xk6 build \
  --with github.com/szkiba/xk6-dotenv@latest

The binary is correctly created with an older version of k6 (v0.45.1).

./k6 version

k6 v0.45.1 ((devel), go1.20.11, darwin/amd64)
Extensions:
  github.com/szkiba/xk6-dotenv v0.1.3, k6/x/dotenv [js]

Similarly, if I build from binary having go installed on my laptop, now specifying the latest k6 version with build latest:

go install go.k6.io/xk6/cmd/xk6@latest
xk6 build latest --with github.com/szkiba/xk6-dotenv@latest
./k6 version

k6 v0.48.0 (go1.21.5, darwin/arm64)
Extensions:
  github.com/szkiba/xk6-dotenv v0.1.3, k6/x/dotenv [js]

Can you share how you built the xk6 binary, what version, and what O.S.?

Cheers!

1 Like

I managed to sort by upgrading the K6 version on windows.
cheers

1 Like