grafana/k6 · error

k6/experimental/redis has been removed. Please migrate to…

Error message

k6/experimental/redis has been removed. Please migrate to the new version by changing your import to 'k6/x/redis'. Read more here: https://grafana.com/docs/k6/latest/javascript-api/k6-x-redis

What it means

The k6/experimental/redis module was promoted and the experimental path removed. jsmodules.go registers a removedModule whose NewModuleInstance throws at import time (internal/js/jsmodules.go:107) with this migration message, directing users to change the import to 'k6/x/redis'.

Solutions

  1. Change the import to 'k6/x/redis': `import redis from 'k6/x/redis'`.
  2. Rename the client import accordingly (`import { RedisClient } from 'k6/x/redis'`) — the API is otherwise the stable continuation.
  3. Check the linked migration docs for any small API deltas.

Example fix

// before
import redis from 'k6/experimental/redis';
// after
import redis from 'k6/x/redis';
Defensive patterns

Strategy: validation

Validate before calling

# fail CI on removed experimental imports before upgrading k6
if grep -rn "k6/experimental/redis" . --include='*.js'; then
  echo 'migrate imports to k6/x/redis'; exit 1
fi

Prevention

When it happens

Trigger: `import redis from 'k6/experimental/redis'` (or RedisClient from it) on any modern k6 binary — the error is thrown the moment the module is instantiated.

Common situations: Scripts written against k6 ~v0.4x–v0.5x using experimental Redis for data sets/Counters; upgrading k6 without touching imports.

Related errors


AI-assisted analysis of grafana/k6@01ffac6f24 (2026-08-18). Data as JSON: /api/errors/c6134fdfbd503c97. Report an issue: GitHub.

Appendix: source

Thrown at internal/js/jsmodules.go:107

	// external is always prefixed with `k6/x`
	for _, e := range external {
		result[e.Name] = e.Module
	}

	return result
}

type removedModule struct {
	errMsg string
}

func newRemovedModule(errMsg string) modules.Module {
	return &removedModule{errMsg: errMsg}
}

func (rm *removedModule) NewModuleInstance(vu modules.VU) modules.Instance {
	common.Throw(vu.Runtime(), errors.New(rm.errMsg))

	return nil
}

type warnExperimentalModule struct {
	once sync.Once
	msg  string
	base modules.Module
}

func newWarnExperimentalModule(base modules.Module, msg string) modules.Module {
	return &warnExperimentalModule{
		msg:  msg,
		base: base,
	}
}

func (w *warnExperimentalModule) NewModuleInstance(vu modules.VU) modules.Instance {

View on GitHub (pinned to 01ffac6f24)