{"record":{"id":"0cf7294a5e4929c1","repo":"grafana/k6","slug":"k6-experimental-timers-has-been-graduated-and-it","errorCode":null,"errorMessage":"k6/experimental/timers has been graduated, and it's now globally available as defined by standard WebAPIs. You just need to remove the import.","messagePattern":"k6/experimental/timers has been graduated, and it's now globally available as defined by standard WebAPIs\\. You just need to remove the import\\.","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/93accf6570dcd306ca5e99cc44c393ee3797761b/internal/js/jsmodules.go#L89-L125","documentation":"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.","triggerScenarios":"`import { setTimeout } from 'k6/experimental/timers'` (or any named import from that path) on a current k6 build.","commonSituations":"Older scripts that needed the polyfill; code copied from pre-graduation examples that still imports the module.","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"],"exampleFix":"// before\nimport { setTimeout } from 'k6/experimental/timers';\nsetTimeout(() => {}, 100);\n\n// after\nsetTimeout(() => {}, 100);","handlingStrategy":"validation","validationCode":"grep -rn \"k6/experimental/timers\" . --include='*.js' && { echo 'timers are global now — delete the import' >&2; exit 1; } || true","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use setTimeout/setInterval without imports — they are globals per WebAPIs","Delete experimental imports as part of every k6 major upgrade checklist"],"tags":["javascript","modules","timers","migration","removed-feature"],"backgroundTag":null,"analyzedSha":"93accf6570dcd306ca5e99cc44c393ee3797761b","analyzedAt":"2026-08-15T21:23:27.118Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}