{"record":{"id":"2679bb633ec8ae82","repo":"grafana/k6","slug":"the-modulespecifier-s-couldn-t-be-retrieved-fro","errorCode":null,"errorMessage":"The moduleSpecifier \"%s\" couldn't be retrieved from the resolved url \"%s\". Error : \"%s\"","messagePattern":"The moduleSpecifier \"(.+?)\" couldn't be retrieved from the resolved url \"(.+?)\"\\. Error : \"(.+?)\"","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/loader/loader.go","lineNumber":169,"sourceCode":"\tdata, err := fsext.ReadFile(filesystems[scheme], pathOnFs)\n\n\tif err == nil {\n\t\treturn &SourceData{URL: moduleSpecifier, Data: data}, nil\n\t}\n\tif !errors.Is(err, fs.ErrNotExist) {\n\t\treturn nil, err\n\t}\n\tif scheme != \"https\" {\n\t\treturn nil, fmt.Errorf(fileSchemeCouldntBeLoadedMsg, originalModuleSpecifier) //nolint:staticcheck\n\t}\n\n\tfinalModuleSpecifierURL := moduleSpecifier\n\n\tvar result *SourceData\n\tresult, err = loadRemoteURL(logger, finalModuleSpecifierURL)\n\tif err != nil {\n\t\t//nolint:staticcheck\n\t\treturn nil, fmt.Errorf(httpsSchemeCouldntBeLoadedMsg, originalModuleSpecifier, finalModuleSpecifierURL, err)\n\t}\n\tresult.URL = moduleSpecifier\n\t// TODO maybe make an fsext.Fs which makes request directly and than use CacheOnReadFs\n\t// on top of as with the `file` scheme fs\n\t_ = fsext.WriteFile(filesystems[scheme], pathOnFs, result.Data, 0o644)\n\n\treturn result, nil\n}\n\nfunc loadRemoteURL(logger logrus.FieldLogger, u *url.URL) (*SourceData, error) {\n\toldQuery := u.RawQuery\n\tif u.RawQuery != \"\" {\n\t\tu.RawQuery += \"&\"\n\t}\n\tu.RawQuery += \"_k6=1\"\n\n\tdata, err := fetch(logger, u.String())\n","sourceCodeStart":151,"sourceCodeEnd":187,"githubUrl":"https://github.com/grafana/k6/blob/01ffac6f245854c1b8adc6a69857c76a15f90022/internal/loader/loader.go#L151-L187","documentation":"Raised in Load when an https module specifier could not be read and the subsequent remote fetch also failed. The message wraps the original specifier, the final resolved URL, and the underlying fetch error, so it means the module exists at neither the local filesystem path nor the remote URL. The at-fault inputs are the specifier, the resolved URL, and the network error.","triggerScenarios":"Thrown at internal/loader/loader.go:169 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check that the resolved URL is reachable (open it in a browser/curl)","Fix network issues: DNS, proxy settings, TLS, or firewall blocking k6","Correct the import specifier if the resolved URL is wrong","Pin the module to an existing version/branch if the remote file was moved or deleted"],"exampleFix":null,"handlingStrategy":"retry","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-14T05:17:10.506Z"}