{"record":{"id":"c20a506e4b9a8806","repo":"grafana/k6","slug":"invalid-option-q","errorCode":null,"errorMessage":"invalid option %q","messagePattern":"invalid option %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/browser/browser/file_persister.go","lineNumber":91,"sourceCode":"\n\t\t\tif hk == \"\" {\n\t\t\t\treturn presignedURLConfig{}, fmt.Errorf(\"empty header key, received %q\", s)\n\t\t\t}\n\t\t}\n\n\t\tswitch k {\n\t\tcase \"url\":\n\t\t\tu, err := url.ParseRequestURI(v)\n\t\t\tif err != nil && u.Scheme != \"\" && u.Host != \"\" {\n\t\t\t\treturn presignedURLConfig{}, fmt.Errorf(\"invalid url %q\", s)\n\t\t\t}\n\t\t\tpresignedURL.getterURL = v\n\t\tcase \"basePath\":\n\t\t\tpresignedURL.basePath = v\n\t\tcase \"header\":\n\t\t\tpresignedURL.headers[hk] = hv\n\t\tdefault:\n\t\t\treturn presignedURLConfig{}, fmt.Errorf(\"invalid option %q\", k)\n\t\t}\n\t}\n\n\tif presignedURL.getterURL == \"\" {\n\t\treturn presignedURLConfig{}, errors.New(\"missing required url\")\n\t}\n\n\treturn presignedURL, nil\n}\n","sourceCodeStart":73,"sourceCodeEnd":101,"githubUrl":"https://github.com/grafana/k6/blob/01ffac6f245854c1b8adc6a69857c76a15f90022/internal/js/modules/k6/browser/browser/file_persister.go#L73-L101","documentation":"Returned while parsing K6_BROWSER_SCREENSHOTS_OUTPUT when a segment's key is not one of the three recognized options: url, basePath, or header.<name>. The switch's default branch rejects everything else, quoting the offending key. This is the typical typo error — e.g. 'ulr=' instead of 'url='.","triggerScenarios":"K6_BROWSER_SCREENSHOTS_OUTPUT containing 'ulr=https://h/' (typo), 'path=/shots' (should be basePath), or 'headers.1=a' (plural — should be header.1).","commonSituations":"Hand-typing the variable in a shell or CI pipeline; mixing up k6's key names with those of another tool; pluralizing 'header'/'basePath'.","solutions":["Correct the key to one of url, basePath, or header.<name> — the error message shows the exact invalid key","Copy the canonical example: url=https://127.0.0.1/,basePath=/screenshots,header.1=a","Remove options the remote endpoint does not need"],"exampleFix":"# before\nexport K6_BROWSER_SCREENSHOTS_OUTPUT='ulr=https://h/,path=/shots'\n# after\nexport K6_BROWSER_SCREENSHOTS_OUTPUT='url=https://h/,basePath=/shots'","handlingStrategy":"validation","validationCode":"const v = process.env.K6_BROWSER_SCREENSHOTS_OUTPUT ?? '';\nif (v) {\n  const allowed = /^(url|basePath|header\\.[^,.]+)$/;\n  const bad = v.split(',').filter(p => !allowed.test(p.split('=')[0]));\n  if (bad.length) throw new Error(`unknown options ${bad.join(' | ')}; allowed keys: url, basePath, header.<name>`);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Spell keys exactly: url, basePath (camelCase), header.<name> (singular)","Add the same allowlist regex to CI env-var checks","The error message quotes the offending key — fix it rather than restructuring the whole value"],"tags":["k6","browser","screenshots","environment-variable","typo","unknown-option"],"backgroundTag":"invalid-env-var-format","analyzedSha":"01ffac6f245854c1b8adc6a69857c76a15f90022","analyzedAt":"2026-08-18T03:05:52.393Z","contentChangedAt":"2026-08-18T03:05:52.393Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}