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

Argument of type 'CustomQueryHandler' is not assignable to parameter of type 'CustomQueryHandler' #77

Open
christian-bromann opened this issue Jul 11, 2022 · 0 comments

Comments

@christian-bromann
Copy link
Member

With the latest release of puppeteer it seems that there are some type issues, e.g.

import puppeteer from 'puppeteer-core'
import { QueryHandler } from 'query-selector-shadow-dom/plugins/puppeteer/index.js'

puppeteer.registerCustomQueryHandler('shadow', QueryHandler)

This fails due to:

Argument of type 'CustomQueryHandler' is not assignable to parameter of type 'import("/workspace/webdriverio/packages/devtools/node_modules/puppeteer-core/lib/types").CustomQueryHandler'.
  Types of property 'queryAll' are incompatible.
    Type '((element: Element | Document, selector: string) => Element[] | NodeListOf<Element>) | undefined' is not assignable to type '((element: Node, selector: string) => Node[]) | undefined'.
      Type '(element: Element | Document, selector: string) => Element[] | NodeListOf<Element>' is not assignable to type '(element: Node, selector: string) => Node[]'.
        Type 'Element[] | NodeListOf<Element>' is not assignable to type 'Node[]'.
          Type 'NodeListOf<Element>' is missing the following properties from type 'Node[]': pop, push, concat, join, and 27 more.ts(2345)
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

1 participant