grafana/k6 · error

touch end

Error message

touch end: %w

What it means

Raised inside Touchscreen.tap when the second CDP call — Input.dispatchTouchEvent with type=touchEnd and an empty touch-point list, carrying the keyboard modifiers — fails. The touchStart half already succeeded, so the page may be left with a stuck pressed state. This fires on CDP-level delivery failure of the release event, e.g. a session that died between the two dispatches.

Solutions

  1. Verify CDP session stability; avoid closing the browser mid-gesture
  2. Retry the full tap so the start/end pair is dispatched consistently
  3. If taps intermittently fail, add a small delay or wait between interactions to keep the session stable
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at internal/js/modules/k6/browser/common/touchscreen.go:53 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of grafana/k6@01ffac6f24 (2026-08-18). Data as JSON: /api/errors/b618c47f0a6f0c61. Report an issue: GitHub.

Appendix: source

Thrown at internal/js/modules/k6/browser/common/touchscreen.go:53

func (t *Touchscreen) tap(x float64, y float64) error {
	touchStart := input.DispatchTouchEvent(
		input.TouchStart,
		[]*input.TouchPoint{{X: x, Y: y}},
	).WithModifiers(
		input.Modifier(t.keyboard.modifiers),
	)
	if err := touchStart.Do(cdp.WithExecutor(t.ctx, t.session)); err != nil {
		return fmt.Errorf("touch start: %w", err)
	}

	touchEnd := input.DispatchTouchEvent(
		input.TouchEnd,
		[]*input.TouchPoint{},
	).WithModifiers(
		input.Modifier(t.keyboard.modifiers),
	)
	if err := touchEnd.Do(cdp.WithExecutor(t.ctx, t.session)); err != nil {
		return fmt.Errorf("touch end: %w", err)
	}

	return nil
}

View on GitHub (pinned to 01ffac6f24)