{"record":{"id":"c6134fdfbd503c97","repo":"grafana/k6","slug":"k6-experimental-redis-has-been-removed-please-mig","errorCode":null,"errorMessage":"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","messagePattern":"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","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/jsmodules.go","lineNumber":107,"sourceCode":"\n\t// external is always prefixed with `k6/x`\n\tfor _, e := range external {\n\t\tresult[e.Name] = e.Module\n\t}\n\n\treturn result\n}\n\ntype removedModule struct {\n\terrMsg string\n}\n\nfunc newRemovedModule(errMsg string) modules.Module {\n\treturn &removedModule{errMsg: errMsg}\n}\n\nfunc (rm *removedModule) NewModuleInstance(vu modules.VU) modules.Instance {\n\tcommon.Throw(vu.Runtime(), errors.New(rm.errMsg))\n\n\treturn nil\n}\n\ntype warnExperimentalModule struct {\n\tonce sync.Once\n\tmsg  string\n\tbase modules.Module\n}\n\nfunc newWarnExperimentalModule(base modules.Module, msg string) modules.Module {\n\treturn &warnExperimentalModule{\n\t\tmsg:  msg,\n\t\tbase: base,\n\t}\n}\n\nfunc (w *warnExperimentalModule) NewModuleInstance(vu modules.VU) modules.Instance {","sourceCodeStart":89,"sourceCodeEnd":125,"githubUrl":"https://github.com/grafana/k6/blob/01ffac6f245854c1b8adc6a69857c76a15f90022/internal/js/jsmodules.go#L89-L125","documentation":"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'.","triggerScenarios":"`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.","commonSituations":"Scripts written against k6 ~v0.4x–v0.5x using experimental Redis for data sets/Counters; upgrading k6 without touching imports.","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."],"exampleFix":"// before\nimport redis from 'k6/experimental/redis';\n// after\nimport redis from 'k6/x/redis';","handlingStrategy":"validation","validationCode":"# fail CI on removed experimental imports before upgrading k6\nif grep -rn \"k6/experimental/redis\" . --include='*.js'; then\n  echo 'migrate imports to k6/x/redis'; exit 1\nfi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Grep the repo for k6/experimental/* after every k6 upgrade — graduated modules keep moving.","Standardize on stable module paths in shared script templates."],"tags":["redis","modules","import","migration","experimental"],"backgroundTag":"removed-module-import","analyzedSha":"01ffac6f245854c1b8adc6a69857c76a15f90022","analyzedAt":"2026-08-18T03:05:52.393Z","contentChangedAt":"2026-08-18T03:05:52.393Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}