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]: Type error: Type instantiation is excessively deep and possibly infinite. #9369

Closed
RomkeSandwave opened this issue Dec 6, 2022 · 5 comments · Fixed by #9370 or #9322
Closed
Assignees

Comments

@RomkeSandwave
Copy link

Bug description

Steps to reproduce the problem:

  1. Query a complex selector in a Typescript puppeteer test script
  2. Typescript complains that resolving the return type takes too many steps: Type error: Type instantiation is excessively deep and possibly infinite.

Puppeteer version

19.3.0

Node.js version

16.18.1

npm version

yarn 1.22.19

What operating system are you seeing the problem on?

Linux

Configuration file

No response

Relevant log output

Type error: Type instantiation is excessively deep and possibly infinite.

  70 | 
> 71 |     const rows = await page.$$( "[data-testid=\"my-component\"] tbody tr" )
     |                        ^
@RomkeSandwave
Copy link
Author

My current workaround:

// Workaround for https://github.com/puppeteer/puppeteer/issues/9369
const rows = await page.$$<"tr">( "[data-testid=\"my-component\"] tbody tr" as unknown as "tr" )

@OrKoN OrKoN self-assigned this Dec 6, 2022
@OrKoN OrKoN added the confirmed label Dec 6, 2022
@OrKoN
Copy link
Collaborator

OrKoN commented Dec 6, 2022

Probably caused by #9253 cc @gomain

As a workaround, you can define selector a string:

const selector = '[data-testid="my-component"] tbody tr';
await page.$$(selector)

Gonna investigate and possible revert the linked PR.

@OrKoN
Copy link
Collaborator

OrKoN commented Dec 6, 2022

@RomkeSandwave which typescript version do you have?

OrKoN added a commit that referenced this issue Dec 6, 2022
Using the accumulator allows enabling the tail-recursion
optimization in the TypeScript compiler.

Closes #9369
Lightning00Blade pushed a commit that referenced this issue Dec 6, 2022
Using the accumulator allows enabling the tail-recursion optimization in
the TypeScript compiler.

Closes #9369
@RomkeSandwave
Copy link
Author

@OrKoN 4.4.3

I'll try upgrading to 4.9.3 and see if that solves it.

@RomkeSandwave
Copy link
Author

Looks to be fixed in Typescript 4.9.3.

OrKoN pushed a commit that referenced this issue Dec 7, 2022
🤖 I have created a release *beep* *boop*
---


<details><summary>puppeteer: 19.4.0</summary>

##
[19.4.0](puppeteer-v19.3.0...puppeteer-v19.4.0)
(2022-12-07)


### Features

* **chromium:** roll to Chromium 109.0.5412.0 (r1069273)
([#9364](#9364))
([1875da6](1875da6)),
closes [#9233](#9233)


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * puppeteer-core bumped from 19.3.0 to 19.4.0
</details>

<details><summary>puppeteer-core: 19.4.0</summary>

##
[19.4.0](puppeteer-core-v19.3.0...puppeteer-core-v19.4.0)
(2022-12-07)


### Features

* ability to send headers via ws connection to browser in node.js
environment
([#9314](#9314))
([937fffa](937fffa)),
closes [#7218](#7218)
* **chromium:** roll to Chromium 109.0.5412.0 (r1069273)
([#9364](#9364))
([1875da6](1875da6)),
closes [#9233](#9233)
* **puppeteer-core:** keydown supports commands
([#9357](#9357))
([b7ebc5d](b7ebc5d))


### Bug Fixes

* **puppeteer-core:** avoid type instantiation errors
([#9370](#9370))
([17f31a9](17f31a9)),
closes [#9369](#9369)
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants