grafana/k6 · error
k6/experimental/timers has been graduated, and it's now glob
Error message
k6/experimental/timers has been graduated, and it's now globally available as defined by standard WebAPIs. You just need to remove the import.
What it means
k6/experimental/timers graduated: setTimeout, setInterval, clearTimeout and clearInterval are now globally available per the standard WebAPIs, so the module was removed entirely. Importing it hits the removedModule stub which throws this message.
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
- Delete the import — the timer functions are global
- Keep the calls as-is (setTimeout(...) works unchanged), or use k6/timers if you prefer explicit imports
Example fix
// before
import { setTimeout } from 'k6/experimental/timers';
setTimeout(() => {}, 100);
// after
setTimeout(() => {}, 100); Defensive patterns
Strategy: validation
Validate before calling
grep -rn "k6/experimental/timers" . --include='*.js' && { echo 'timers are global now — delete the import' >&2; exit 1; } || true Prevention
- Use setTimeout/setInterval without imports — they are globals per WebAPIs
- Delete experimental imports as part of every k6 major upgrade checklist
When it happens
Trigger: `import { setTimeout } from 'k6/experimental/timers'` (or any named import from that path) on a current k6 build.
Common situations: Older scripts that needed the polyfill; code copied from pre-graduation examples that still imports the module.
Related errors
- k6/experimental/redis has been removed. Please migrate to th
- k6/experimental/browser has been graduated, please use k6/br
- k6/experimental/grpc has been graduated, please use k6/net/g
- k6/experimental/tracing has been removed. All of it function
- k6/experimental/webcrypto has been graduated and it's now gl
AI-assisted analysis of grafana/k6@93accf6570 (2026-08-15).
Data as JSON: /api/errors/0cf7294a5e4929c1.
Report an issue: GitHub.