microsoft / microsoft/TypeScript

Some Playwright types now reported as `any` after upgrading to 5.7.2

Open
#60,619 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Domain: check: Type Inference Help Wanted Possible Improvement
Dominant language
Go
Stars
111k
Forks
14.3k
Avg merge
2d 4h
Merged PRs (30d)
132

Description

🔎 Search Terms

I manually scrolled through all issues reported since the release of 5.7.2.

🕗 Version & Regression Information
  • This changed between versions 5.6.3 and 5.7.2
⏯ Playground Link

https://github.com/mrmckeb/pw-repro

💻 Code

Minimal repro available here:
https://github.com/mrmckeb/pw-repro

The Playwright team are also able to reproduce:
https://github.com/microsoft/playwright/issues/33763

The affected code (from the repro) is:

import { test as base, expect } from "@playwright/test";

const test = base.extend({
  // baseUrl, page, use are now `any`
  page: async ({ baseURL, page }, use) => {
    await page.goto(baseURL);
    await use(page);
  },
});
🙁 Actual behavior

Types that were previously available are now typed as any. JSDoc continues to work as expected.

🙂 Expected behavior

Types behave as they did in TypeScript 5.6.3.

Additional information about the issue

We found this issue when upgrading from 5.6.3 to 5.7.2. I couldn't find a related issue here, so raised it at the Playwright repo to at least verify that they could reproduce and that they didn't think it was an issue with their types.

The Playwright team also confirmed that they have 71 new errors across 41 files when moving to TypeScript 5.7.2.

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

Start with the minimal reproduction in the linked pw-repro repository and compare its behavior under TypeScript 5.6.3 and 5.7.2. Use the affected Playwright extension code as the focused case, then consult the linked Playwright issue and TypeScript regression behavior. Done means the affected values are no longer reported as any and the 5.7.2 type-checking errors are resolved.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.