microsoft / microsoft/playwright-dotnet

[Regression]: "playwright.ps1 install" crashes in branches with older version when newer version was installed in another branch

Open
#2,959 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

P3-collecting-feedback
Dominant language
C#
Stars
3k
Forks
304
Avg merge
20h 47m
Merged PRs (30d)
6

Description

Last Good Version

1.44.0

First Bad Version

1.45.0

Steps to reproduce
  1. Create branch "A" where code references Microsoft.Playwright.NUnit 1.44.0

  2. Run "playwright.ps1 install" - works as expected

  3. Run tests - works as expected

  4. Create branch "B" where code references Microsoft.Playwright.NUnit 1.45.0

  5. Run "playwright.ps1 install" - works as expected

  6. Run tests - works as expected

  7. Change back to branch "A"

  8. Run "playwright.ps1 install" - fails with error below

  9. Run tests - fails with error below

ERROR:
node:internal/modules/cjs/loader:1148
throw err;
^
Error: Cannot find module './clock'

Expected behavior

"playwright.ps1 install" should not fail. If the versions are incompatible/different, then playwright.ps1 should install the version it expects.

Actual behavior

"playwright.ps1 install" fails

node:internal/modules/cjs/loader:1148
throw err;
^

Error: Cannot find module './clock'

Additional context

Cleaning the solution after changing branches is a valid workaround, but wasn't necessary before.

Environment
- Operating System: Microsoft Windows 10 Pro
- CPU: Intel64
- .NET Version (TFM): [net8.0]

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue with branches referencing Microsoft.Playwright.NUnit 1.44.0 and 1.45.0, using playwright.ps1 install and the listed Windows/.NET environment. Start by tracing how the script selects its version and handles the Node module error after switching branches. Done means playwright.ps1 install and the tests work again on both branches without requiring a solution clean.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, node.js, powershell
Domain
testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.