Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Regression]: TypeError: Cannot read properties of undefined (reading 'expectInfo') #35138

Open
Smrtnyk opened this issue Mar 11, 2025 · 2 comments · May be fixed by #35149
Open

[Regression]: TypeError: Cannot read properties of undefined (reading 'expectInfo') #35138

Smrtnyk opened this issue Mar 11, 2025 · 2 comments · May be fixed by #35149

Comments

@Smrtnyk
Copy link

Smrtnyk commented Mar 11, 2025

Last Good Version

1.50

First Bad Version

1.51

Steps to reproduce

  1. clone my repo https://github.com/Smrtnyk/PW-repros
  2. Run the asymmetric matcher test

Expected behavior

In version 1.50 the error message was clear

Actual behavior

In version 1.51 a weird exception happens TypeError: Cannot read properties of undefined (reading 'expectInfo')
I suspect it is related to this commit 4b64c47

Additional context

No response

Environment

System:
    OS: Windows 11 10.0.26100
    CPU: (24) x64 12th Gen Intel(R) Core(TM) i9-12950HX
    Memory: 35.97 GB / 63.69 GB
  Binaries:
    Node: 22.12.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.19 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 10.9.0 - C:\Program Files\nodejs\npm.CMD
    pnpm: 9.12.0 - ~\AppData\Roaming\npm\pnpm.CMD
  IDEs:
    VSCode: 1.96.0 - C:\workspaces\devtools\Microsoft VS Code\bin\code.CMD
  Languages:
    Bash: 5.2.26 - C:\Program Files\Git\usr\bin\bash.EXE
  npmPackages:
    @playwright/test: 1.51.0 => 1.51.0
@pavelfeldman
Copy link
Member

Playwright is not Jest, we don't support extending async matchers. But more importantly, how is it that your asymmetric matchers are on the left-hand side? Should be only right-hand side!

Image

@Smrtnyk
Copy link
Author

Smrtnyk commented Mar 11, 2025

This is not an async matcher, where do you see async behavior?
it checks if property is undefined or instance of something
like a can be undefined or number 3 for example. (just an enhanced version of expect.any)
We are running this code for years in playwright, and it broke in v1.51

But more importantly, how is it that your asymmetric matchers are on the left-hand side? Should be only right-hand side!

I don't understand this part, can you clarify?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants