{"record":{"id":"d30375791f569525","repo":"grafana/k6","slug":"tla-in-go-modules-is-not-supported-in-k6-at-the-mo","errorCode":null,"errorMessage":"TLA in go modules is not supported in k6 at the moment","messagePattern":"TLA in go modules is not supported in k6 at the moment","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"js/modules/require_impl.go","lineNumber":84,"sourceCode":"\t}\n\treturn rt.NamespaceObjectFor(m), nil\n}\n\nfunc (ms *ModuleSystem) getModuleInstanceFromGoModule(wm *goModule) (wmi *goModuleInstance, err error) {\n\trt := ms.vu.Runtime()\n\tmi := rt.GetModuleInstance(wm)\n\tif mi == nil {\n\t\terr = wm.Link()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tpromise := rt.CyclicModuleRecordEvaluate(wm, ms.resolver.sobekModuleResolver)\n\t\tswitch promise.State() {\n\t\tcase sobek.PromiseStateRejected:\n\t\t\terr = promise.Result().Export().(error) //nolint:forcetypeassert\n\t\tcase sobek.PromiseStateFulfilled:\n\t\tdefault:\n\t\t\tpanic(\"TLA in go modules is not supported in k6 at the moment\")\n\t\t}\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tmi = rt.GetModuleInstance(wm)\n\t}\n\tgmi, ok := mi.(*goModuleInstance)\n\tif !ok {\n\t\tpanic(fmt.Sprintf(\"a goModule instance is of not goModuleInstance type (got %T). \"+\n\t\t\t\"This is a k6 bug please report it (https://github.com/grafana/k6/issues)\", mi))\n\t}\n\treturn gmi, nil\n}\n\n// Resolve returns what the provided specifier will get resolved to if it was to be imported\n// To be used by other parts to get the path\nfunc (ms *ModuleSystem) Resolve(mr sobek.ModuleRecord, specifier string) (*url.URL, error) {\n\tif specifier == \"\" {","sourceCodeStart":66,"sourceCodeEnd":102,"githubUrl":"https://github.com/grafana/k6/blob/01ffac6f245854c1b8adc6a69857c76a15f90022/js/modules/require_impl.go#L66-L102","documentation":"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.","triggerScenarios":"Thrown at js/modules/require_impl.go:84 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","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"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"01ffac6f245854c1b8adc6a69857c76a15f90022","analyzedAt":"2026-08-18T03:05:52.393Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}