xvrh / puppeteer-dart

A Dart library to automate the Chrome browser over the DevTools Protocol. This is a port of the Puppeteer API
BSD 3-Clause "New" or "Revised" License
236 stars 59 forks source link

Bad state: Future already completed #308

Closed lukeanderson-wk closed 6 months ago

lukeanderson-wk commented 6 months ago

Suggested fix for an exception we've intermittently been experiencing on puppeteer-dart v2.24.0

If this fix seems appropriate, can it also be backported since we're still on v2?

Bad state: Future already completed
dart:async                                                                                 _AsyncCompleter.complete
package:puppeteer/src/page/dom_world.dart 478:18                                           WaitTask.rerun
===== asynchronous gap ===========================
dart:async                                                                                 _CustomZone.registerUnaryCallback
package:puppeteer/src/page/dom_world.dart 461:21                                           WaitTask.rerun
package:puppeteer/src/page/dom_world.dart 439:5                                            new WaitTask
package:puppeteer/src/page/dom_world.dart 388:20                                           DomWorld._waitForSelectorOrXPath
package:puppeteer/src/page/dom_world.dart 328:12                                           DomWorld.waitForXPath
package:puppeteer/src/page/frame_manager.dart 867:40                                       Frame.waitForXPath
package:puppeteer/src/page/page.dart 1912:22                                               Page.waitForXPath
xvrh commented 6 months ago

Thanks for the contribution!

kendalsickels-wf commented 6 months ago

@xvrh can we also get this released on 2.24.1? We're still working through null safety which means we can't use v3 of puppeteer-dart just yet. fyi @lukeanderson-wk

mikedonner-wf commented 6 months ago

+1 would love to have this on v2!