-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Open
Labels
Description
Version
1.58.1
Steps to reproduce
- Clone my repo: https://github.com/lhfmartin/lihkg-snapshot-viewer
git switch feature-use-docker-browser-for-testspnpm ipnpm test- You should see that 3 tests fail with the error
TypeError: The "path" argument must be of type string. Received undefined
The error happens on the Github Actions pipeline too: https://github.com/lhfmartin/lihkg-snapshot-viewer/actions/runs/22018054724/job/63622672363
Expected behavior
I expect that the error TypeError: The "path" argument must be of type string. Received undefined will not be thrown
Actual behavior
The tests fail with the error TypeError: The "path" argument must be of type string. Received undefined
Additional context
The error is due to f.path in
| const files = localDirectory ? (await platform.fs().promises.readdir(localDirectory, { withFileTypes: true, recursive: true })).filter(f => f.isFile()).map(f => platform.path().join(f.path, f.name)) : localPaths!; |
The path attribute in the Dirent object is deprecated a few versions ago and is removed in node.js 24. It should be replaced with parentPath
Environment
System:
OS: macOS 15.7.1
Binaries:
Node: 24.13.1
npm: 11.8.0
pnpm: 10.29.3
Languages:
Bash: 3.2.57 - /bin/bash
npmPackages:
@playwright/test: ^1.58.1 => 1.58.1Reactions are currently unavailable