I've seen this issue pop up in several places, but it keeps being closed without any meaningful explanation or resolution.
Very frequently, but without any consistency (I can't identify any pattern), when I set a breakpoint and then compile or source a script, R throws an error similar to this:
Error in length(steps) == x || nchar(steps) == x :
'length = x' in coercion to 'logical(x)'
Where x is an integer that can vary, but otherwise the error is always the same. For example:
Error in length(steps) == 0 || nchar(steps) == 0 :
'length = 2' in coercion to 'logical(1)'
Clearing the breakpoints allows me to source again. However, this may be unrelated, but sometimes I cannot clear all the breakpoints. They stay with a hollow circle and I can't get rid of them. At that point I can't source at all and have to restart the IDE.
EDIT: I forgot to mention, another issue that seems to be related to this is whenever I try to set a breakpoint, I get a message at the top that says "Breakpoints will be activated when the file or function is finished executing.", but the file has been sourced and there is nothing executing. The breakpoint shows as hollow circle. Sometimes it works anyway and sometimes it doesn't.
This problem has plagued me for the past several R and RStudio versions, not sure how far back, but it seems to be getting worse. It's been at least a year. I keep updating everything every chance I get hoping this will go away, but it doesn't.
I saw an explanation that I didn't really understand on Stack Overflow that suggested this had to do with some packages not being properly updated after some change in base R. Unfortunately, due the nature of R I am using several dozen 3rd party packages in hundreds if not thousands of lines of code. I wouldn't even know where to begin to diagnose this. I'm not fully convinced that this is a package problem though, as this problem ONLY appears when I set a breakpoint, which to me points to an RStudio problem.
At any rate, this error message is completely useless. It doesn't give even a clue as to where the error is coming from. If there's no will to find and fix the error, maybe we can get some code in the error handler to better identify where the error is coming from?