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

[🐛 Bug]: including webdriverio as a ts dep generates a build error regarding puppeteer-core #10726

Closed
3 tasks done
Tracked by #10362
jlipps opened this issue Jul 13, 2023 · 4 comments
Closed
3 tasks done
Tracked by #10362
Assignees
Milestone

Comments

@jlipps
Copy link
Contributor

jlipps commented Jul 13, 2023

Have you read the Contributing Guidelines on issues?

WebdriverIO Version

8.12.1

Node.js Version

18.15.0

Mode

Standalone Mode

Which capabilities are you using?

not relevant

What happened?

Trying to compile my TS based project which uses WDIO as a dependency, and getting stuck on this error:

node_modules/puppeteer-core/lib/esm/puppeteer/common/Debug.d.ts:22:62 - error TS7016: Could not find a declaration file for module 'debug'. '/Users/jlipps/Code/gh/jlipps/appium-ocr-plugin/node_modules/puppeteer-core/node_modules/debug/src/index.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/debug` if it exists or add a new declaration (.d.ts) file containing `declare module 'debug';`

22 export declare function importDebug(): Promise<typeof import('debug')>;

I'm not using puppeteer-core at all. It appears to be imported by WDIO.

What is your expected behavior?

No WDIO-related TS build issues

How to reproduce the bug.

Try to build this project at this branch: https://github.com/jlipps/appium-ocr-plugin/tree/jlipps/updates

Relevant log output

n/a

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
@jlipps jlipps added Bug 🐛 Needs Triaging ⏳ No one has looked into the issue yet labels Jul 13, 2023
@christian-bromann
Copy link
Member

Thanks for reporting @jlipps

Unfortunately the webdriverio package currently has puppeteer as a sub-dependency. I have planned to change that by embedding all browser drivers into webdriverio. Until that happened I recommend to work around this issue by following the suggestions mentioned in the error message or use the --transpile-only parameter to just suppress this message.

@christian-bromann christian-bromann removed the Needs Triaging ⏳ No one has looked into the issue yet label Jul 13, 2023
@christian-bromann christian-bromann self-assigned this Jul 13, 2023
@jlipps
Copy link
Contributor Author

jlipps commented Jul 14, 2023

OK, thanks @christian-bromann! I've followed the type dep workaround for now. Sounds like this is pretty low priority but was just a surprise mostly that it wasn't "clean" to use wdio in a ts project in this way.

@christian-bromann
Copy link
Member

Given this would be a breaking change, I will add it to the v9 roadmap. I suggest to move puppeteer-core to a peer-dependency and verify that it is installed when calling getPuppeteer.

@christian-bromann
Copy link
Member

I've implemented the changes for this in the v9 branch. We don't have alpha releases yet but hopefully get to that soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

2 participants