-
Notifications
You must be signed in to change notification settings - Fork 48
Description
Error description
When interactively developing in RStudio, I often might run selections of code by running line by line or highlighting a section to run with cmd + enter or the Run button. This occasionally generates errors when running box::use(local/module), even though the relative sourcing is correct. Below is an example with two modules a and b in the same directory:
a.R
#' Title
#' @export
a <- function() {
print("I am a")
}b.R
box::use(./a)
a$a()If I open up b.R and highlight the code and run, it is successful:
However, if I leave the same code block highlighted, restart my R session, and click run without re-highlighting the code, it fails, indicating that it is unable to load module a in my current project directory.
However, clicking back on the b.R script and running line by line or re-highlighting will successfully run. With more complex modules with multiple imports, running code line by line can generate the same error, where it seems the RStudio pathing has lost track of the source file and defaults to project directory or base directory, depending if in a project environment or not.
I can explore a more complex reprex if helpful. This is not a critical bug, but something other colleagues have noticed so flagging here.
R version
_
platform x86_64-apple-darwin20
arch x86_64
os darwin20
system x86_64, darwin20
status
major 4
minor 3.3
year 2024
month 02
day 29
svn rev 86002
language R
version.string R version 4.3.3 (2024-02-29)
nickname Angel Food Cake
RStudio version
$mode
[1] "desktop"
$version
[1] ‘2023.12.1.402’
$long_version
[1] "2023.12.1+402"
$release_name
[1] "Ocean Storm"
‘box’ version
‘1.2.0’

