{"record":{"id":"c269937d4ae61ad1","repo":"grafana/k6","slug":"k6-couldn-t-detect-google-chrome-or-a-chromium-sup-c26993","errorCode":null,"errorMessage":"k6 couldn't detect google chrome or a chromium-supported browser on the given path: %s","messagePattern":"k6 couldn't detect google chrome or a chromium-supported browser on the given path: (.+?)","errorType":"exception","errorClass":"ErrChromeNotFoundAtPath","httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/browser/chromium/browser_type.go","lineNumber":366,"sourceCode":"\n\t// ErrChromeNotFoundAtPath is returned when the Chrome executable is not found at the given path.\n\tErrChromeNotFoundAtPath = errors.New(\n\t\t\"k6 couldn't detect google chrome or a chromium-supported browser on the given path\",\n\t)\n)\n\n// executablePath returns the path where the extension expects to find the browser executable.\nfunc executablePath(\n\tpath string,\n\tenv env.LookupFunc,\n\tlookPath func(file string) (string, error), // os.LookPath\n) (string, error) {\n\t// find the browser executable in the user provided path\n\tif path := strings.TrimSpace(path); path != \"\" {\n\t\tif _, err := lookPath(path); err == nil {\n\t\t\treturn path, nil\n\t\t}\n\t\treturn \"\", fmt.Errorf(\"%w: %s\", ErrChromeNotFoundAtPath, path)\n\t}\n\n\t// find the browser executable in the default paths below\n\tpaths := []string{\n\t\t// Unix-like\n\t\t\"headless_shell\",\n\t\t\"headless-shell\",\n\t\t\"chromium\",\n\t\t\"chromium-browser\",\n\t\t\"google-chrome\",\n\t\t\"google-chrome-stable\",\n\t\t\"google-chrome-beta\",\n\t\t\"google-chrome-unstable\",\n\t\t\"/usr/bin/google-chrome\",\n\t\t// Windows\n\t\t\"chrome\",\n\t\t\"chrome.exe\", // in case PATHEXT is misconfigured\n\t\t`C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe`,","sourceCodeStart":348,"sourceCodeEnd":384,"githubUrl":"https://github.com/grafana/k6/blob/93accf6570dcd306ca5e99cc44c393ee3797761b/internal/js/modules/k6/browser/chromium/browser_type.go#L348-L384","documentation":"This is the ErrChromeNotFoundAtPath sentinel (defined alongside ErrChromeNotInstalled) returned by executablePath() when the user explicitly provided a browser executable path but exec.LookPath could not resolve it. The '%s' suffix in the message echoes the offending path, and the sentinel supports errors.Is matching. Launch fails before spawning anything.","triggerScenarios":"Setting options.executablePath / K6_BROWSER_EXECUTABLE_PATH to a nonexistent file; a relative path that does not resolve against k6's working directory; a path with a typo or wrong container mount; a path to a file without the executable bit or with wrong arch (LookPath behavior aside, unresolvable names fail); spaces or shell metacharacters in an unquoted path.","commonSituations":"Path works on the developer machine (/usr/bin/google-chrome) but the CI image keeps Chromium at /usr/bin/chromium; docker volume mounts the browser at a different path than the env var says; Windows paths with backslashes mangled by YAML escaping; pointing at the Chrome directory instead of the binary itself.","solutions":["Check the exact path from the error message: ls -l <path-from-error> on the machine/container running k6","Point executablePath at the real binary (e.g. /usr/bin/chromium or 'C:\\\\Program Files\\\\Google\\\\Chrome\\\\Application\\\\chrome.exe'), or the headless_shell binary shipped in k6 browser images","Use an absolute path — relative paths resolve against k6's cwd, not the script location","If the binary exists, ensure it is executable (chmod +x) and matches the container architecture","Alternatively clear executablePath to let k6 auto-detect a system browser from its default list"],"exampleFix":"# before\nexport K6_BROWSER_EXECUTABLE_PATH=/usr/bin/google-chrome  # not present in this image\n\n# after\nexport K6_BROWSER_EXECUTABLE_PATH=/usr/bin/chromium\n# or omit it and rely on auto-detection","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  const browser = chromium.launch({ executablePath: CHROME });\n} catch (e) {\n  const m = String(e.message);\n  if (m.includes(\"couldn't detect google chrome or a chromium-supported browser on the given path\")) {\n    throw new Error(`Chrome not found at ${CHROME}; verify the path inside the container running k6`);\n  }\n  throw e;\n}","preventionTips":["Use absolute paths for executablePath; verify with ls in the same container","Derive the path from one env var used by both the Dockerfile and the test","If the path varies per environment, fall back to auto-detection by omitting executablePath"],"tags":["launch","executable","configuration","docker","path"],"backgroundTag":null,"analyzedSha":"93accf6570dcd306ca5e99cc44c393ee3797761b","analyzedAt":"2026-08-15T21:23:27.118Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}