You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 11, 2024. It is now read-only.
fix(puppeteer): Wait until networkidle2 for better dev server support (#63)
Switches to networkidle2 during Puppeteer navigation, preventing
timeouts when requesting pages that are served from development
environments like webpack-dev-server (which holds open event-
source sockets for HMR).
The networkidle2 event is fired when there are no more than 2 network
connections for at least 500 ms. If the page you're requesting has 2 or
fewer resources that stall for longer than 500ms and doesn't complete
loading, you can switch back to networkidle0 using the new
`--puppeteer-wait-until` option.
*Note: Because Puppeteer args are prefixed with hyphens, you **must** use an equals sign and quotes when providing this option via the command line (as seen above).*
213
213
214
+
### Puppeteer `waitUntil`
215
+
216
+
By default, Puppeteer is configured to consider the page loaded when there are no more than 2 network connections for at least 500ms (`networkidle2`). This is so that html-sketchapp-cli can handle development environments with long-lived connections.
217
+
218
+
If the page you're requesting has 2 or fewer resources that stall for longer than 500ms and doesn't complete loading, you can switch back to `networkidle0` via the `puppeteer-wait-until` argument:
For the full list of available options for `waitUntil`, view the [Puppeteer `page.goto()` API documentation](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#pagegotourl-options).
225
+
214
226
### Chromium executable
215
227
216
228
If you'd like to override the Chromium used by Puppeteer, you can provide a path to the executable with the `puppeteer-executable-path` option.
0 commit comments