webdriverio: [🐛 Bug]: `Cannot find name 'browser'.ts(2304)` and `Namespace 'global.WebdriverIO' has no exported member 'Element'.ts(2694)`
Have you read the Contributing Guidelines on issues?
- I have read the Contributing Guidelines on issues.
WebdriverIO Version
latest
Node.js Version
v14.15.1
Mode
WDIO Testrunner
Which capabilities are you using?
No response
What happened?
I just created a default project with latest everything choosing TypeScript and Cucumber. Tests pass, but when I go to the pageobjects fijes I get the following errors:
Namespace 'global.WebdriverIO' has no exported member 'Element' .ts(2694)
Cannot find name '$'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery`.ts(2581)
Cannot find name 'browser'.ts(2304)
What is your expected behavior?
This errors should not be popping.
How to reproduce the bug.
- Create npm project (
npm init -y) - Create wdio project (
npm init wdio)- Selected typescript and cucumber
- Run automatically generated tests -> pass
- Go to see pageobjects at
features/pageobjects - See TS errors raise with
WebdriverIO.Elementand,browserand$objects:
Namespace 'global.WebdriverIO' has no exported member 'Element' .ts(2694)
Cannot find name '$'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery`.ts(2581)
Cannot find name 'browser'.ts(2304)
Relevant log output
Namespace 'global.WebdriverIO' has no exported member 'Element' .ts(2694)
Cannot find name '$'. Do you need to install type definitions for jQuery? Try `npm i --save-dev @types/jquery`.ts(2581)
Cannot find name 'browser'.ts(2304)
### Code of Conduct
- [X] I agree to follow this project's Code of Conduct
### Is there an existing issue for this?
- [X] I have searched the existing issues
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 23 (4 by maintainers)
~same here 😞~ works using Node 16 and the following tsconfig.json setting:
👍🏻
Already fixed it. Apparently the installer sent my
tsconfigand mywdio.confas well inside a/test/directory. Never happened to me before. Easy fix though.`{
}` Still facing this issue. even, edit as yours… above is my tsconfig.json… Is it Correct or need to change anything…