{"record":{"id":"7128dba5cdd29209","repo":"grafana/k6","slug":"local-or-remote-path-required","errorCode":null,"errorMessage":"local or remote path required","messagePattern":"local or remote path required","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/loader/loader.go","lineNumber":50,"sourceCode":"\t\t`local disk. Make sure that you've specified the right path to the file. If you're ` +\n\t\t`running k6 using the Docker image make sure you have mounted the ` +\n\t\t`local directory (-v /local/path/:/inside/docker/path) containing ` +\n\t\t`your script and modules so that they're accessible by k6 from ` +\n\t\t`inside of the container, see ` +\n\t\t`https://grafana.com/docs/k6/latest/using-k6/modules/#use-modules-with-docker.`\n)\n\ntype unresolvableURLError string\n\nfunc (u unresolvableURLError) Error() string {\n\t// TODO potentially add more things about what k6 supports if users report being confused.\n\treturn fmt.Sprintf(`The moduleSpecifier %q couldn't be recognised as something k6 supports.`, (string)(u))\n}\n\n// Resolve a relative path to an absolute one.\nfunc Resolve(pwd *url.URL, moduleSpecifier string) (*url.URL, error) {\n\tif moduleSpecifier == \"\" {\n\t\treturn nil, errors.New(\"local or remote path required\")\n\t}\n\n\tif moduleSpecifier[0] == '.' || moduleSpecifier[0] == '/' || filepath.IsAbs(moduleSpecifier) {\n\t\treturn resolveFilePath(pwd, moduleSpecifier)\n\t}\n\n\tif strings.Contains(moduleSpecifier, \"://\") {\n\t\tu, err := url.Parse(moduleSpecifier)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif u.Scheme != \"file\" && u.Scheme != \"https\" {\n\t\t\treturn nil,\n\t\t\t\tfmt.Errorf(\"only supported schemes for imports are file and https, %s has `%s`\",\n\t\t\t\t\tmoduleSpecifier, u.Scheme)\n\t\t}\n\t\tif u.Scheme == \"file\" && pwd.Scheme == \"https\" {\n\t\t\treturn nil, fmt.Errorf(\"origin (%s) not allowed to load local file: %s\", pwd, moduleSpecifier)","sourceCodeStart":32,"sourceCodeEnd":68,"githubUrl":"https://github.com/grafana/k6/blob/93accf6570dcd306ca5e99cc44c393ee3797761b/internal/loader/loader.go#L32-L68","documentation":"Error \"local or remote path required\" thrown in grafana/k6.","triggerScenarios":"Thrown at internal/loader/loader.go:50 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"}