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

fix(runStaticServer): Don't fail when trying to open browser #395

Merged
merged 3 commits into from
Feb 2, 2024

Conversation

gadenbuie
Copy link
Member

@gadenbuie gadenbuie commented Feb 1, 2024

Encountered in #393

Before

library(httpuv)
options(browser = character())

runStaticServer(
  system.file("example-static-site", package = "httpuv"),
  browse = TRUE
)
#> Serving: '/Users/garrick/Library/R/arm64/4.3/library/httpuv/example-static-site'
#> View at: http://127.0.0.1:7446
#> Error in utils::browseURL(paste0("http://", host, ":", port)): 'browser' must be a non-empty character string

After

library(httpuv)
options(browser = character())

s <- runStaticServer(
  system.file("example-static-site", package = "httpuv"),
  browse = TRUE,
  background = TRUE
)
#> Serving: '/Users/garrick/work/rstudio/httpuv/inst/example-static-site'
#> View at: http://127.0.0.1:34950
#> Could not open browser due to error in `utils::browseURL()`: 'browser' must be a non-empty character string
s$stop()

@wch wch merged commit 5dff313 into main Feb 2, 2024
23 checks passed
@cpsievert cpsievert deleted the gadenbuie-patch-1 branch February 2, 2024 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants