{"record":{"id":"849daed043d2eb0e","repo":"grafana/k6","slug":"the-modulespecifier-s-couldn-t-be-found-on-loca","errorCode":null,"errorMessage":"The moduleSpecifier \"%s\" couldn't be found on local disk. Make sure that you've specified the right path to the file. If you're running k6 using the Docker image make sure you have mounted the local directory (-v /local/path/:/inside/docker/path) containing your script and modules so that they're accessible by k6 from inside of the container, see https://grafana.com/docs/k6/latest/using-k6/modules/#use-modules-with-docker.","messagePattern":"The moduleSpecifier \"(.+?)\" couldn't be found on local disk\\. Make sure that you've specified the right path to the file\\. If you're running k6 using the Docker image make sure you have mounted the local directory \\(-v /local/path/:/inside/docker/path\\) containing your script and modules so that they're accessible by k6 from inside of the container, see https://grafana\\.com/docs/k6/latest/using-k6/modules/#use-modules-with-docker\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/loader/loader.go","lineNumber":141,"sourceCode":"\tlogger logrus.FieldLogger, filesystems map[string]fsext.Fs, moduleSpecifier *url.URL, originalModuleSpecifier string,\n) (*SourceData, error) {\n\tlogger.WithFields(\n\t\tlogrus.Fields{\n\t\t\t\"moduleSpecifier\":         moduleSpecifier,\n\t\t\t\"originalModuleSpecifier\": originalModuleSpecifier,\n\t\t}).Debug(\"Loading...\")\n\n\tvar pathOnFs string\n\tswitch moduleSpecifier.Scheme {\n\tcase \"\":\n\t\tpathOnFs = path.Clean(moduleSpecifier.String())\n\tdefault:\n\t\tpathOnFs = path.Clean(moduleSpecifier.String()[len(moduleSpecifier.Scheme)+len(\":/\"):])\n\t}\n\tscheme := moduleSpecifier.Scheme\n\tif scheme == \"\" {\n\t\tif moduleSpecifier.Opaque == \"\" {\n\t\t\treturn nil, fmt.Errorf(fileSchemeCouldntBeLoadedMsg, originalModuleSpecifier) //nolint:staticcheck\n\t\t}\n\t\tscheme = \"https\"\n\t}\n\n\tpathOnFs, err := url.PathUnescape(filepath.FromSlash(pathOnFs))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\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\" {","sourceCodeStart":123,"sourceCodeEnd":159,"githubUrl":"https://github.com/grafana/k6/blob/01ffac6f245854c1b8adc6a69857c76a15f90022/internal/loader/loader.go#L123-L159","documentation":"Error \"The moduleSpecifier \"%s\" couldn't be found on local disk. Make sure that you've specified the right path to the file. If you're running k6 using the Docker image make sure you have mounted the local directory (-v /local/path/:/inside/docker/path) containing your script and modules so that they're accessible by k6 from inside of the container, see https://grafana.com/docs/k6/latest/using-k6/modules/#use-modules-with-docker.\" thrown in grafana/k6.","triggerScenarios":"Thrown at internal/loader/loader.go:141 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the module specifier/path is spelled correctly and the file exists","When running in Docker, mount the directory containing the script and modules (-v /local/path/:/inside/docker/path) and use /inside/docker/path paths","Use an absolute path or file:// URL to disambiguate","For remote modules, ensure the https URL is correct and reachable"],"exampleFix":null,"handlingStrategy":"fallback","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"}