grafana/k6 · error
TLA in go modules is not supported in k6 at the moment
Error message
TLA in go modules is not supported in k6 at the moment
What it means
In getModuleInstanceFromGoModule, evaluating the go module's cyclic module record left the result promise in a pending state (neither fulfilled nor rejected). Since native Go modules cannot perform top-level await, a pending promise means unsupported TLA semantics — k6 panics rather than hang.
Source
Thrown at js/modules/require_impl.go:84
}
return rt.NamespaceObjectFor(m), nil
}
func (ms *ModuleSystem) getModuleInstanceFromGoModule(wm *goModule) (wmi *goModuleInstance, err error) {
rt := ms.vu.Runtime()
mi := rt.GetModuleInstance(wm)
if mi == nil {
err = wm.Link()
if err != nil {
return nil, err
}
promise := rt.CyclicModuleRecordEvaluate(wm, ms.resolver.sobekModuleResolver)
switch promise.State() {
case sobek.PromiseStateRejected:
err = promise.Result().Export().(error) //nolint:forcetypeassert
case sobek.PromiseStateFulfilled:
default:
panic("TLA in go modules is not supported in k6 at the moment")
}
if err != nil {
return nil, err
}
mi = rt.GetModuleInstance(wm)
}
gmi, ok := mi.(*goModuleInstance)
if !ok {
panic(fmt.Sprintf("a goModule instance is of not goModuleInstance type (got %T). "+
"This is a k6 bug please report it (https://github.com/grafana/k6/issues)", mi))
}
return gmi, nil
}
// Resolve returns what the provided specifier will get resolved to if it was to be imported
// To be used by other parts to get the path
func (ms *ModuleSystem) Resolve(mr sobek.ModuleRecord, specifier string) (*url.URL, error) {
if specifier == "" {View on GitHub (pinned to 01ffac6f24)
Solutions
- Remove top-level await usage from the affected native module integration
- Update k6 — TLA support may be added in later versions
- Report at https://github.com/grafana/k6/issues if no TLA is used
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at js/modules/require_impl.go:84 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of grafana/k6@01ffac6f24 (2026-08-18).
Data as JSON: /api/errors/d30375791f569525.
Report an issue: GitHub.