Skip to content

[Bug]: Wrong line numbers in reports with type: module in package.json and Node.js 24.12.0#38578

@dword-design

Description

@dword-design

Version

1.57.0

Steps to reproduce

  1. Clone https://github.com/dword-design/demo-playwright-tests-wrong-line-numbers
  2. Have Node.js 24.12.0 installed and active
  3. npm ci
  4. npx playwright test
import{test}from'@playwright/test';test('test',()=>{});

Expected behavior

Running 1 test using 1 worker ✓ 1 tests/example.spec.ts:3:1 › test (1ms) 1 passed (396ms)

Actual behavior

Running 1 test using 1 worker ✓ 1 tests/example.spec.ts:2:1 › test (1ms) 1 passed (396ms)

Additional context

  • I think it's related to fix(test runner): prevent esm loader deadlock #36187 where the source map loading was unblocked, but I guess the source maps are not there when the tests are loaded
  • It works when type: module is removed from package.json
  • It works in other Node.js versions, it only doesn't work with 24.12.0
  • I also somehow got it to work with PLAYWRIGHT_WAIT_FOR_SOURCE_MAPS but it also lead to infinite loading issues (which probably is why the behavior has been changed)

Environment

System: OS: macOS 15.5 CPU: (8) arm64 Apple M1 Pro Memory: 129.92 MB / 16.00 GB Binaries: Node: 24.12.0 - /Users/sebastianlandwehr/.nvm/versions/node/v24.12.0/bin/node Yarn: 1.22.22 - /Users/sebastianlandwehr/.nvm/versions/node/v24.12.0/bin/yarn npm: 11.6.2 - /Users/sebastianlandwehr/.nvm/versions/node/v24.12.0/bin/npm pnpm: 10.26.0 - /Users/sebastianlandwehr/.nvm/versions/node/v24.12.0/bin/pnpm IDEs: VSCode: 1.106.3 - /usr/local/bin/code Languages: Bash: 3.2.57 - /bin/bash npmPackages: @playwright/test: ^1.57.0 => 1.57.0

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