grafana/k6 · error · ErrChromeNotFoundAtPath

k6 couldn't detect google chrome or a chromium-supported…

Error message

k6 couldn't detect google chrome or a chromium-supported browser on the given path

What it means

Variant of the executable lookup failure where you explicitly configured a path: executablePath trims the user-supplied value and checks it, returning ErrChromeNotFoundAtPath (chromium/browser_type.go:350) when the given path does not exist as a usable executable. k6 never falls back to autodetection once a path is provided, so the path must be correct.

Solutions

  1. Verify the path exists inside the environment k6 runs in: ls -l /usr/bin/chromium
  2. Use an absolute path with no spaces or shell expansions; avoid ~
  3. Ensure the file is executable: chmod +x /path/to/chrome
  4. In containers, double-check the volume mount and that the path is the binary itself, not its directory

Example fix

# before
K6_BROWSER_PATH=/usr/local/bin/chrome k6 run script.js  # file not there in container

# after
docker run -v /opt/chrome:/opt/chrome:ro -e K6_BROWSER_PATH=/opt/chrome/chrome grafana/k6 run - < script.js
Defensive patterns

Strategy: validation

Validate before calling

# verify the configured executable before the run
K6_BROWSER_PATH="${K6_BROWSER_PATH:-/usr/bin/chromium}"
[ -x "$K6_BROWSER_PATH" ] || { echo "$K6_BROWSER_PATH is not an executable file" >&2; exit 1; }
k6 run script.js

Prevention

When it happens

Trigger: Setting K6_BROWSER_PATH (or execPath) to a nonexistent path, a typo'd path, a directory, a non-executable file, or a path that exists on the host but not inside the container (missing volume mount / different mount namespace).

Common situations: Docker/k6 containers where the Chrome mount is missing or mounted at a different path; macOS host paths (/Applications/...) reused in Linux CI; spaces or unexpanded ~ in the path; binaries copied without the execute bit.

Related errors


AI-assisted analysis of grafana/k6@8d06114777 (2026-08-18). Data as JSON: /api/errors/69ee079592973e86. Report an issue: GitHub.

Appendix: source

Thrown at internal/js/modules/k6/browser/chromium/browser_type.go:350

		}
	}()

	args, err := parseArgs(flags)
	if err != nil {
		return nil, err
	}

	return common.NewLocalBrowserProcess(bProcCtx, path, args, dataDir, bProcCtxCancel, logger) //nolint: wrapcheck
}

var (
	// ErrChromeNotInstalled is returned when the Chrome executable is not found.
	ErrChromeNotInstalled = errors.New(
		"k6 couldn't detect google chrome or a chromium-supported browser on this system",
	)

	// ErrChromeNotFoundAtPath is returned when the Chrome executable is not found at the given path.
	ErrChromeNotFoundAtPath = errors.New(
		"k6 couldn't detect google chrome or a chromium-supported browser on the given path",
	)
)

// executablePath returns the path where the extension expects to find the browser executable.
func executablePath(
	path string,
	env env.LookupFunc,
	lookPath func(file string) (string, error), // os.LookPath
) (string, error) {
	// find the browser executable in the user provided path
	if path := strings.TrimSpace(path); path != "" {
		if _, err := lookPath(path); err == nil {
			return path, nil
		}
		return "", fmt.Errorf("%w: %s", ErrChromeNotFoundAtPath, path)
	}

View on GitHub (pinned to 8d06114777)