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

type error puppeteerUtils.gotoExtended ? #2398

Closed
1 task
KOCEAN33 opened this issue Apr 2, 2024 · 0 comments · Fixed by #2399
Closed
1 task

type error puppeteerUtils.gotoExtended ? #2398

KOCEAN33 opened this issue Apr 2, 2024 · 0 comments · Fixed by #2399
Assignees
Labels
bug Something isn't working.

Comments

@KOCEAN33
Copy link

KOCEAN33 commented Apr 2, 2024

Which package is this bug report for? If unsure which one to select, leave blank

@crawlee/utils

Issue description

when use puppeteerUtils.gotoExtended, type of waitUntil funtion is define to 'domcontentloaded' | 'load' | 'networkidle';
but if i use 'networkidle', i got the error Unknown value for options.waitUntil: networkidle

i found PuppeteerLifeCycleEvent type (https://pptr.dev/api/puppeteer.puppeteerlifecycleevent)

export type PuppeteerLifeCycleEvent =
  /**
   * Waits for the 'load' event.
   */
  | 'load'
  /**
   * Waits for the 'DOMContentLoaded' event.
   */
  | 'domcontentloaded'
  /**
   * Waits till there are no more than 0 network connections for at least `500`
   * ms.
   */
  | 'networkidle0'
  /**
   * Waits till there are no more than 2 network connections for at least `500`
   * ms.
   */
  | 'networkidle2';

and networkidle0 seems working. Is this type from a feature I don't know or is it not updated?
I'm happy if you check it out

Code sample

// profit type but got error from puppeteer 
await puppeteerUtils.gotoExtended(page, request, {waitUntil: 'networkidle'})

// got type error but works
await puppeteerUtils.gotoExtended(page, request, {waitUntil: 'networkidle0'})

Package version

3.8.2

Node.js version

20.11.0

Operating system

Windows 11

Apify platform

  • Tick me if you encountered this issue on the Apify platform

I have tested this on the next release

No response

Other context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants