grafana/k6 · info

parsing fill options: %w

Error message

parsing fill options: %w

What it means

Options passed to frame.fill(selector, value, opts) failed to parse (frame_mapping.go:98). FrameFillOptions delegates to ElementHandleBaseOptions.Parse, which only coerces 'force', 'noWaitAfter', and 'timeout' and always returns nil in this codebase - so this branch is defensive and effectively unreachable in the current version.

Source

Thrown at internal/js/modules/k6/browser/browser/frame_mapping.go:98

		},
		"evaluateHandle": func(pageFunc sobek.Value, gargs ...sobek.Value) (*sobek.Promise, error) {
			if sobekEmptyString(pageFunc) {
				return nil, fmt.Errorf("evaluateHandle requires a page function")
			}
			funcString := pageFunc.String()
			gopts := exportArgs(gargs)
			return promise(vu, func() (any, error) {
				jsh, err := f.EvaluateHandle(funcString, gopts...)
				if err != nil {
					return nil, err //nolint:wrapcheck
				}
				return mapJSHandle(vu, jsh), nil
			}), nil
		},
		"fill": func(selector, value string, opts sobek.Value) (*sobek.Promise, error) {
			popts := common.NewFrameFillOptions(f.Timeout())
			if err := popts.Parse(vu.Context(), opts); err != nil {
				return nil, fmt.Errorf("parsing fill options: %w", err)
			}
			return promise(vu, func() (any, error) {
				return nil, f.Fill(selector, value, popts) //nolint:wrapcheck
			}), nil
		},
		"focus": func(selector string, opts sobek.Value) (*sobek.Promise, error) {
			popts := common.NewFrameBaseOptions(f.Timeout())
			if err := popts.Parse(vu.Context(), opts); err != nil {
				return nil, fmt.Errorf("parsing focus options: %w", err)
			}
			return promise(vu, func() (any, error) {
				return nil, f.Focus(selector, popts) //nolint:wrapcheck
			}), nil
		},
		"frameElement": func() *sobek.Promise {
			return promise(vu, func() (any, error) {
				fe, err := f.FrameElement()
				if err != nil {

View on GitHub (pinned to 93accf6570)

Solutions

  1. Pass a plain options object with supported keys: { timeout: 5000, force: true }
  2. Reproduce on the latest stable k6 and report an issue with the script if it persists
  3. Pin a known-good k6 version while investigating
Defensive patterns

Strategy: try-catch

Validate before calling

const safeOpts = { force: !!opts?.force, noWaitAfter: !!opts?.noWaitAfter, timeout: Number(opts?.timeout) || undefined, strict: !!opts?.strict };

Try / catch

try {
  await frame.fill(sel, value, safeOpts);
} catch (e) {
  console.error(`fill(${sel}) failed: ${e.message}`);
}

Prevention

When it happens

Trigger: No fill option ({ force, noWaitAfter, timeout, strict }) can trigger it today; values are coerced, not validated. It would only fire if a k6 version made these parsers type-sensitive.

Common situations: Rarely seen; appears mainly against custom k6 builds or after upstream changes to the option parsers.

Related errors


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