Skip to content

[Bug]: Playwright 1.58.0 collects *.esm.preflight files as tests, causing duplicate test title errors #39028

@Abhinegi2

Description

@Abhinegi2

Version

1.58.0

After upgrading @playwright/test from 1.57.0 to 1.58.0 in a TypeScript ESM project that uses import "tsx/esm" in playwright.config.ts, Playwright reports duplicate test titles. The duplicates reference files named *.esm.preflight (e.g. sometest-tests.spec.ts.esm.preflight) even though those files are not part of our repo.

Downgrading to 1.57.0 resolves the issue.

Steps to reproduce

  1. Use Node 20+ with "type": "module" in package.json.
  2. In playwright.config.ts, import tsx/esm:
    import "tsx/esm";

Here you can see the actual error -https://github.com/Aam-Digital/ndb-core/actions/runs/21467121434/job/61831518943?pr=3626

Expected behavior

Playwright should only execute the real *.spec.ts files and not collect any *.esm.preflight artifacts.

Actual behavior

Playwright errors with duplicate test title messages:
Error: duplicate test title "Edit existing Name field to set and reset default value", first declared in admin-tests.spec.ts.esm.preflight:3

Additional context

Regression:

  • 1.57.0: no duplicate title errors
  • 1.58.0: duplicate title errors referencing *.esm.preflight

Environment

OS: macOS (arm64)
@playwright/test: 1.58.0
tsx: 4.21.0
type: "module" in package.json

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions