Hi. I've found base::browser() extremely useful when develop (also debugging) shiny-apps.
I often use browser() inside a shiny::moduleServer() to develop further as this allows me to have all of the environment variables coming from input and other reactives very quickly (Working extremely well with shiny::reactiveConsole(TRUE)).
However, when writing something in console or either run some code the browser() functionality keeps sending me to a temporary file with message in top: "Debug location is approximate because the source is not available".
Is there any way to disable this behavior or maybe I've missed out on a similar functionality that is build for this
I've tried to create a reprex below:
char_names <-
c("run1",
"run2",
"run3",
"run4")
purrr::map(char_names, .f = function(.x) {
base::browser()
paste(.x, "some more text .....")
})
I am also experiencing this, and it worsened after a recent upgrade to RStudio 2021.09.0.
To restate what happens exactly: Adding a browser() call inside a function or a reactive environment in a Shiny app is super handy to debug because once the browser() triggers, you can interact with the local environment and the reactive values.
However, since recently, every time you run some code while being in "Browser mode", even basic code like 1+1, a new tab opens which is a temporary file with Debug location is approximate because the source is not available.
This is not helpful at all. This temporary file can't even be edited. To continue working, you have to close it, go back to where you were, until you run the next command. And when you run the next command, the temporary file opens again. If you run 50 commands, you'll have to go through this cycle 50 times, which is incredibly frustrating.
Here is a short video that illustrates the issue: Link to video. Notice how whenever I type something, the temporary file opens and disrupt everything.
Whenever I work on a complex Shiny app, I spend most of my time in "Browser mode" because it is so handy to debug but also code from scratch, having access to the reactive inputs/variables. This new feature/bug makes it next to impossible.