Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v0.1.0 throws "panic: module already registered: k6/x/redis" #10

Closed
vincentdaniel opened this issue Aug 3, 2022 · 1 comment
Closed

Comments

@vincentdaniel
Copy link

vincentdaniel commented Aug 3, 2022

Since the extension was made importable by k6 in v0.1.0, we are getting an error when running k6 with xk6-redis:

goroutine 1 [running]:
go.k6.io/k6/js/modules.Register({0x102f1454e, 0xa}, {0x10325e5c0?, 0x103e44830})
	go.k6.io/k6@v0.38.2/js/modules/modules.go:54 +0x18c
github.com/grafana/xk6-redis.init.0()
	github.com/grafana/xk6-redis@v0.1.0/register.go:10 +0x3c

Steps to reproduce

script.js:

import redis from 'k6/x/redis';

export const redisClient = new redis.Client({
    addrs: new Array("localhost:6379"),
    password: 'redis',
    db: 0,
  });

export default function () {

}

script.sh

go install go.k6.io/xk6/cmd/xk6@latest
xk6 build --with github.com/grafana/xk6-redis
./k6 run script.js

./script.sh

Workaround

Use previous version : xk6 build --with github.com/grafana/xk6-redis@100588d

Comment

I guess the warning was there for a reason 😄
This extension is going under heavy changes and is about to make it to k6's core. USE AT YOUR OWN RISK!

But I wanted to still raise the issue in case there is a better workaround or a way to fix the current version to make it work with current readme 😉

@mstoykov
Copy link
Contributor

Thanks for reporting this :bow. This was fixed with #11, but we forgot to mention it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants