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
- Change the import to 'k6/x/redis': `import redis from 'k6/x/redis'`.
- Rename the client import accordingly (`import { RedisClient } from 'k6/x/redis'`) — the API is otherwise the stable continuation.
- 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
- Grep the repo for k6/experimental/* after every k6 upgrade — graduated modules keep moving.
- Standardize on stable module paths in shared script templates.
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
- k6/experimental/browser has been graduated, please use…
- k6/experimental/grpc has been graduated, please use…
- k6/experimental/timers has been graduated, and it's now…
- local or remote path required
- cannot be null or undefined
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)