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

Could not find a declaration file for module 'query-selector-shadow-dom/plugins/puppeteer' #57

Open
Tigrao75 opened this issue Apr 22, 2021 · 2 comments

Comments

@Tigrao75
Copy link

Hi @Georgegriff ,
Sorry to bother you, but I'm facing some problems using your plugin. I tried to figure out the problem myself, but I couldn't.
So, I thought to ask for your help:
I used your example for PUPPETEER for shadow-dom and I getting error in the "require":
const { QueryHandler } = require("query-selector-shadow-dom/plugins/puppeteer");

I got this error when I hover the mouse in this line:
"module "C:/Puppeteer/node_modules/query-selector-shadow-dom/plugins/puppeteer/index"
Could not find a declaration file for module 'query-selector-shadow-dom/plugins/puppeteer'. 'C:/Puppeteer/node_modules/query-selector-shadow-dom/plugins/puppeteer/index.js' implicitly has an 'any' type.
Try npm i --save-dev @types/query-selector-shadow-dom if it exists or add a new declaration (.d.ts) file containing declare module 'query-selector-shadow-dom/plugins/puppeteer';ts(7016)"

I'm using visual Code. I'm able to see the plugin instaled but even so, I get this annoying error and my query is not woking and I think this error is the problem.

Thank you in advance.
Luciano.

@Georgegriff
Copy link
Contributor

This looks like a typescript issue, I don't believe there are types declares for this plugin, feel free to contribute some if you want, other than that you should be able to ignore the typescript error somehow

As an aside puppeteer has a built in selector named pierce, they don't document it which is a bit annoying, but puppeteer/puppeteer#6509

@Georgegriff
Copy link
Contributor

You could also document the types yourself in your project, someone in webdriverio recently did they for the web driver plugin https://github.com/webdriverio/webdriverio/blob/0535493274b6f3b7ff5d7c5a44731e3d6d8ea461/%40types/query-selector-shadow-dom.d.ts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants