grafana/k6 · error

k6/experimental/browser has been graduated, please use k6/br

Error message

k6/experimental/browser has been graduated, please use k6/browser instead.Please update your imports to use k6/browser instead of k6/experimental/browser, For more information, see the migration guide at the link: https://grafana.com/docs/k6/latest/using-k6-browser/migrating-to-k6-v0-52/

What it means

k6/experimental/browser graduated to the stable k6/browser module in k6 v0.52 and the experimental path was removed. The removedModule stub throws this error when the old import is instantiated, pointing at the v0.52 migration guide.

Source

Thrown at internal/js/jsmodules.go:107

	// external is always prefixed with `k6/x`
	for _, e := range external {
		result[e.Name] = e.Module
	}

	return result
}

type removedModule struct {
	errMsg string
}

func newRemovedModule(errMsg string) modules.Module {
	return &removedModule{errMsg: errMsg}
}

func (rm *removedModule) NewModuleInstance(vu modules.VU) modules.Instance {
	common.Throw(vu.Runtime(), errors.New(rm.errMsg))

	return nil
}

type warnExperimentalModule struct {
	once sync.Once
	msg  string
	base modules.Module
}

func newWarnExperimentalModule(base modules.Module, msg string) modules.Module {
	return &warnExperimentalModule{
		msg:  msg,
		base: base,
	}
}

func (w *warnExperimentalModule) NewModuleInstance(vu modules.VU) modules.Instance {

View on GitHub (pinned to 93accf6570)

Solutions

  1. Change the import to 'k6/browser': `import { browser } from 'k6/browser'`
  2. Review the migration guide for behavioral changes (e.g. waitForTimeout removal, options moves) and fix any follow-on errors

Example fix

// before
import { browser } from 'k6/experimental/browser';

// after
import { browser } from 'k6/browser';
Defensive patterns

Strategy: validation

Validate before calling

# Codemod the graduated import
sed -i "s|k6/experimental/browser|k6/browser|g" tests/**/*.js
grep -rn "k6/experimental/browser" tests/ && exit 1 || true

Prevention

When it happens

Trigger: `import { browser } from 'k6/experimental/browser'` in a script executed on k6 >= v0.52 (with the old path removed).

Common situations: Browser scripts predating v0.52 run on a newer binary; CI images bumped to latest k6 without updating test scripts.

Related errors


AI-assisted analysis of grafana/k6@93accf6570 (2026-08-15). Data as JSON: /api/errors/bdac8d20906e5678. Report an issue: GitHub.