Skip to content

Vitest browser-mode: 'Unknown event: response:response:...' errors when running multiple click tests #69

@simshanith

Description

@simshanith

Summary

When running multiple browser tests with vitest that involve click events on anchor elements, thousands of "Unknown event: response:response:response:..." errors occur, causing the test runner to fail even though all tests pass.

Reproduction

  1. Clone this repo and checkout commit 9d116d4 (also tagged issue-reproduction/simshanith/lit-ui-router/issues/69)
  2. Run pnpm install
  3. Run the skipped tests - may need to edit to unskip first
    pnpm --filter lit-ui-router test ui-sref.spec -t "click modifiers" --browser=chromium

Expected behavior

Tests pass with no errors.

Actual behavior

Tests pass but with thousands of errors like:

Error: Unknown event: response:response:response:response:response:execute
Error: Unknown event: response:response:response:response:response:cleanup

The response: prefix accumulates recursively.

Key Details

  • Issue only occurs when multiple tests run - individual tests pass without errors
  • Tests involve click events on anchor elements
  • Anchors may trigger navigation via router.stateService.go()
  • Some tests use target="_blank" or rel="external" attributes
  • Test suites affected: "click modifiers", "target attribute" in ui-sref.spec.ts
  • Running these suites together causes exponential error accumulation

Environment

  • vitest: 4.0.16
  • @vitest/browser-playwright: 4.0.16
  • playwright: 1.54.1
  • Node: v22.x
  • OS: macOS

Workaround

Tests are currently skipped with .skip - see commit 9d116d4

Related

Will file upstream issue on vitest-dev/vitest.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions