Error related to devtools::load_all()
in .Rprofile
#9743
-
I decided to first ask here since I'm not sure if this is a bug or I'm just doing something I shouldn't. Question: is it bad practice to try including I had this in if (Sys.getenv("USE_RENV", unset = "TRUE") == "TRUE") {
source("renv/activate.R")
}
if (requireNamespace("devtools", quietly = TRUE)) {
devtools::load_all()
} I just installed Positron and tried opening my project and this is what I see:
If I reduce the if (Sys.getenv("USE_RENV", unset = "TRUE") == "TRUE") {
source("renv/activate.R")
} Then there's no error anymore. Is there something wrong with loading things in PS: The error indeed still happens if the content of devtools::load_all() |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
I guess I wouldn't call it bad but rather sort of pointless/weird? And then, given the way it's interacting with startup, that makes it bad. In terms of how I work, I don't necessarily do |
Beta Was this translation helpful? Give feedback.
I agree with Jenny, for sure!
From a standpoint of what's happening here, the R code in
devtools::load_all()
uses the rstudioapi package to save untitled files you may have. R is trying to this before all the connecting is fully wired up between R and Positron ("UI comm is not connected"). Your.Rprofile
is run pretty early in the process of startup, and there aren't guarantees about Positron being fully ready to hear from R before it is run. If we made some change here, it would make R even slower to be started than it already is.