{"record":{"id":"08a59ace3b54b7bf","repo":"grafana/k6","slug":"a-gomodule-instance-is-of-not-gomoduleinstance-typ","errorCode":null,"errorMessage":"a goModule instance is of not goModuleInstance type (got %T). This is a k6 bug please report it (https://github.com/grafana/k6/issues)","messagePattern":"a goModule instance is of not goModuleInstance type \\(got %T\\)\\. This is a k6 bug please report it \\(https://github\\.com/grafana/k6/issues\\)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"js/modules/require_impl.go","lineNumber":93,"sourceCode":"\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 == \"\" {\n\t\treturn nil, errors.New(\"require() can't be used with an empty specifier\")\n\t}\n\n\tbaseModuleURL := ms.resolver.reversePath(mr)\n\treturn ms.resolver.resolveSpecifier(baseModuleURL, specifier)\n}\n\n// CurrentlyRequiredModule returns the module that is currently being required.\n// It is mostly used for old and somewhat buggy behaviour of the `open` call","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/grafana/k6/blob/93accf6570dcd306ca5e99cc44c393ee3797761b/js/modules/require_impl.go#L75-L111","documentation":"Error \"a goModule instance is of not goModuleInstance type (got %T). This is a k6 bug please report it (https://github.com/grafana/k6/issues)\" thrown in grafana/k6.","triggerScenarios":"Thrown at js/modules/require_impl.go:93 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"93accf6570dcd306ca5e99cc44c393ee3797761b","analyzedAt":"2026-08-15T21:23:27.118Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}