rstudio / rsconnect

Publish Shiny Applications, RMarkdown Documents, Jupyter Notebooks, Plumber APIs, and more
http://rstudio.github.io/rsconnect/
133 stars 81 forks source link

Unable to obtain dependencies with renv #951

Closed ischmidt20 closed 1 year ago

ischmidt20 commented 1 year ago

I am trying to publish a Shiny application to a Posit Connect server. I am using renv version 1.0.1 for package management, the lockfile looks good, and renv reports that nothing is out of sync. However, whenever I try to publish, I see the following error:

Error in if (pkg$Repository == "CRAN") { : argument is of length zero

I have traced this issue to the call to rsconnect::appDependencies(), as I see the same error when calling that function from the console. Here is the full traceback:

6: FUN(X[[i]], ...)

5: lapply(packages, standardizeRenvPackage, availablePackages = availablePackages,

       biocPackages = biocPackages, repos = repos)

4: standardizeRenvPackages(renv$Packages, repos, biocPackages = biocPackages(bundleDir))

3: parseRenvDependencies(bundleDir)

2: computePackageDependencies(bundleDir, extraPackages, quiet = TRUE)

1: rsconnect::appDependencies()

Any idea what could be causing this, or if there is a workaround? At the moment it is preventing me from publishing my Shiny app.

aronatkins commented 1 year ago

The particular line of code you reference was adjusted in https://github.com/rstudio/rsconnect/pull/931

Could you try using the latest development version of rsconnect to see if that helps or produces better feedback?

remotes::install_github("rstudio/rsconnect")

Additionally, any chance that you could create a reprex to help us produce the same error? It would be useful to see your getOption("repos") and how packages were installed.

ischmidt20 commented 1 year ago

Could you try using the latest development version of rsconnect to see if that helps or produces better feedback?

This worked, thanks!

Packages were installed via the standard install.packages method, with the following repo:

> getOption("repos")
                         CRAN 
"https://cloud.r-project.org"

Upon installing the dev version, rsconnect::appDependencies() now returns the appropriate data frame with Repository equal to "https://cloud.r-project.org" for all packages (with the exception of rsconnect).

aronatkins commented 1 year ago

The version you tested was released to CRAN as rsconnect-1.0.2. Please let us know if you continue to have problems.