'How to debug R-Shiny code with VS Code
Solution 1:[1]
Seems, shiny can be debugged in VSCode using browser-statements ?
Prerequisites
- Setup this VSCode extensions (VSCode R Guide)
- R (by Yuki Ueda)
- R Debugger
- Use a default app structure (see docs of
appDirwhen running?shiny::runAppfor possible setups) - Set your VSCode workspace to the R projects root (e.g. File -> Open Folder... -> myProject)
Debugging
- Set your breakpoints using
browser()(RStudio Article) - Run R-Debugger in Launch R-Workspace mode
- Execute
shiny::runApp()in the Debug Console as soon the Debugger pauses - Your app should fire up in a browser and the breakpoints pause the execution ?
Further Ressources
- VSCode Article on debugging (can be very helpfull)
- Issue on this topic in the VSCode-R-Debugger repo
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |
