Skip to content

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

@christian-bromann

Description

@christian-bromann

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions