Skip to content

Commit 9648efe

Browse files
authored
fix: default value of --wait-for option (#1730)
1 parent b373971 commit 9648efe

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

docs/guide/exporting.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -171,15 +171,15 @@ Some parts of your slides may require a longer time to render. You can use the `
171171
$ slidev export --wait 10000
172172
```
173173

174-
There is also a `--wait-until` option to wait for a state before exporting each slide:
174+
There is also a `--wait-until` option to wait for a state before exporting each slide. If you keep encountering timeout issues, you can try setting this option:
175175

176176
```bash
177177
$ slidev export --wait-until none
178178
```
179179

180180
Possible values:
181181

182-
- `'networkidle'` - (_default_) consider operation to be finished when there are no network connections for at least `500` ms. Don't use this method for testing, rely on web assertions to assess readiness instead.
182+
- `'networkidle'` - (_default_) consider operation to be finished when there are no network connections for at least `500` ms. This is the safest, but may cause timeouts.
183183
- `'domcontentloaded'` - consider operation to be finished when the `DOMContentLoaded` event is fired.
184184
- `'load'` - consider operation to be finished when the `load` event is fired.
185185
- `'none'` - do not wait for any event.

packages/slidev/node/commands/export.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,7 @@ export function getExportOptions(args: ExportArgs, options: ResolvedSlidevOption
597597
format: (format || 'pdf') as 'pdf' | 'png' | 'pptx' | 'md',
598598
timeout: timeout ?? 30000,
599599
wait: wait ?? 0,
600-
waitUntil: waitUntil === 'none' ? undefined : waitUntil as 'networkidle' | 'load' | 'domcontentloaded',
600+
waitUntil: waitUntil === 'none' ? undefined : (waitUntil ?? 'networkidle') as 'networkidle' | 'load' | 'domcontentloaded',
601601
dark: dark || options.data.config.colorSchema === 'dark',
602602
routerMode: options.data.config.routerMode,
603603
width: options.data.config.canvasWidth,

0 commit comments

Comments
 (0)