-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
Closed
Copy link
Labels
Bug 🐛good first picka reasonable task to start getting familiar with the code basea reasonable task to start getting familiar with the code basehelp wantedIssues that are free to take by anyone interestedIssues that are free to take by anyone interested
Description
Have you read the Contributing Guidelines on issues?
- I have read the Contributing Guidelines on issues.
WebdriverIO Version
Tested in 8.15.10 (latest as of writing), introduced in 8.11.0
Node.js Version
Verified in 18.17.1, 20.5.1
Mode
Standalone Mode
Which capabilities are you using?
n/aWhat happened?
As of PR #9640, WebdriverIO's typings include two copies of the Browser type, one a global type within the WebdriverIO namespace and one a type primitive exported from the module.
PR #10447 made an update to to the primitive export, but not the global namespace version.
In practice, this means that code which tries to use import type { Browser } from 'webdriverio' is incompatible with webdriverio functions that return WebdriverIO.Browser, such as remote.
What is your expected behavior?
The two copies of the type should match, ideally with one defined in terms of the other to avoid this issue in the future
How to reproduce the bug.
// repro.ts
import { type Browser, remote } from 'webdriverio';
async function main() {
let browser: Browser; // works if using WebdriverIO.Browser instead
browser = await remote({
capabilities: { browserName: 'irrelevant' }
});
}$ npm init -y
$ npm install webdriverio@8.15.10 typescript@5.2.2
$ npx tsc --noEmit --skipLibCheck ./repro.tsRelevant log output
repro.ts:7:5 - error TS2740: Type 'Browser' is missing the following properties from type 'Browser': sessionStatus, sessionNew, sessionEnd, sessionSubscribe, and 25 more.
7 browser = await remote({
~~~~~~~
Found 1 error in repro.ts:Code of Conduct
- I agree to follow this project's Code of Conduct
Is there an existing issue for this?
- I have searched the existing issues
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Bug 🐛good first picka reasonable task to start getting familiar with the code basea reasonable task to start getting familiar with the code basehelp wantedIssues that are free to take by anyone interestedIssues that are free to take by anyone interested