Unable to build custom k6 binary with extensions

I am trying to build custom k6 binary using extensions and everytime the build proces is throwing error

Simple dockerfile i am using:

# Use the official golang image as the base image
FROM golang:latest AS builder
# Install git (required to fetch k6 and xk6 extensions)
RUN apt-get update && apt-get install -y git
# Set the working directory in the container
# Fetch xk6
RUN go install go.k6.io/xk6/cmd/xk6@latest
# Create a custom k6 build with extensions
RUN xk6 build latest --with github.com/szkiba/xk6-chai

Error: 18.46 go.buf.build/grpc/go/prometheus/prometheus: unrecognized import path "go.buf.build/grpc/go/prometheus/prometheus":

Hello @lucky041295! Looks like you’ve stumbled into an issue our developers are currently working on, and will produce a patched version of k6. For the meantime, my understanding that you can work around this issue by adding the following to your xk6 build ... command:

--replace go.buf.build/grpc/go/prometheus/prometheus=buf.build/gen/go/prometheus/prometheus/protocolbuffers/go@latest --replace go.buf.build/grpc/go/gogo/protobuf=buf.build/gen/go/gogo/protobuf/protocolbuffers/go@latest

Hi @lucky041295

Welcome to the community forum :wave:

You can follow the issue investigation in Extensions build process fails due to go.buf.build · Issue #3252 · grafana/k6 · GitHub.

And many thanks for reporting this!

thank you @eyeveebee , will keep an eye on this.

1 Like

Hi @lucky041295

A patch version v0.45.1 was released.

Again, thanks for reporting the issue.