We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0a55fdf commit 483e473Copy full SHA for 483e473
src/wasm.rs
@@ -12,7 +12,11 @@ pub(super) fn open_browser_internal(
12
13
// always return true for a dry run
14
if options.dry_run {
15
- return Ok(());
+ if let Some(_) = web_sys::window() {
16
+ return Ok(());
17
+ } else {
18
+ return Err(Error::new(ErrorKind::Other, "no browser window available"));
19
+ }
20
}
21
22
let window = web_sys::window();
@@ -30,10 +34,7 @@ pub(super) fn open_browser_internal(
30
34
Err(Error::new(ErrorKind::Other, "error opening url"))
31
35
32
36
},
33
- None => Err(Error::new(
- ErrorKind::Other,
- "should have a window in this context",
- )),
37
+ None => Err(Error::new(ErrorKind::Other, "no browser window available")),
38
39
40
0 commit comments