grafana/k6 · error

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

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 removed from the core distribution. Its registry entry is a stub (removedModule) whose NewModuleInstance throws this message the moment the import is instantiated, directing users to the k6/x/redis module.

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 93accf6570)

Solutions

  1. Change the import to 'k6/x/redis': `import redis from 'k6/x/redis'` (bundled with k6, no custom build needed)
  2. Adjust field usage per the linked migration docs if the client API changed

Example fix

// before
import redis from 'k6/experimental/redis';

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

Strategy: validation

Validate before calling

# Block removed-module imports before running
grep -nE "from 'k6/experimental/(redis|browser|grpc|timers|tracing|webcrypto)'" script.js && { echo 'Removed module import found — migrate per error message' >&2; exit 1; }

Prevention

When it happens

Trigger: `import redis from 'k6/experimental/redis'` (or `import redis from 'k6/experimental/redis'` variants) in any script run on a current k6 build.

Common situations: Scripts written against k6 < v0.5x after a k6 upgrade; tutorials referencing the experimental module path.

Related errors


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