You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let me start by saying I think it's great what's possible in this new version of Plumber!
I was particularly interested in running a Shiny app through the API, but unfortunately I cannot seem to make this work. Below is my (hopefully) reproducible example
#* Echo the parameter that was sent in#*#* @get /echo/<msg>#*#* @param msg:string The message to echo back.#*function(msg) {
list(
msg= paste0("The message is: '", msg, "'")
)
}
#* @shiny /devAppshiny::shinyAppDir(system.file("examples-shiny", "01_hello", package="shiny"))
When I now click the Run API button in R Studio, the server starts, and the echo endpoint is working. However, if I navigate to the devApp endpoint I get {"error":"404 - Resource Not Found"}
Also the @shiny tag is not suggested in autocomplete and seems to be absent from the package
This did initially work when I navigated to the UI endpoint. However, now it's also broken giving me Internal Server Error (I tried installing the dev version and the the original one again so maybe that's the reason here?)
I can sadly not replicate these shiny issues but since multiple people are reporting it I can only assume that it is a real issue in plumber2 or some platform specific issue. Can I get you to share your session info?
Both result in a fully functional Shiny session; the WebSocket handshake completes, inputs are initialized, and outputs render correctly.
A few findings worth noting below that may or may not be worth pursuing more, but thought I'd mention them:
Trailing slash on the access URL
Regardless of whether the path is registered as /ui or /ui/, the app only serves correctly when navigating to the trailing-slash URL in the browser (http://127.0.0.1:8080/ui/). This is expected behavior given how browsers resolve relative asset paths from an HTML document, not a routing bug, but it is easy to get wrong initially since its all silent, i.e. shiny routes don't appear in the OpenAPI __docs__ interface, there's no auto-launch behavior for mounted apps, and the natural URL to try is whatever path string was passed to api_shiny(), which without the slash fails silently even when provided a slash-less route (i.e. "/ui" vs "/ui/").
A small quality-of-life improvement that would eliminate this entirely could be a startup message from api_run() noting the correct access URL for each mounted Shiny app, e.g.:
ℹ Shiny app mounted at http://127.0.0.1:8080/ui/
using the cli URL markup etc.
No routing changes needed, just surfacing the correct URL at run time would be enough
shinyAppDir() path resolution
Relative paths passed to shinyAppDir() fail with ! No Shiny application exists at the path "./app". Absolute paths work fine. This may be a working directory mismatch between the R session's getwd() and the directory containing plumber.R but may be worth investigating whether plumber2 should normalize the working directory when sourcing the file, or at minimum document that absolute paths are required.
Activity
thomasp85 commentedon Dec 15, 2025
Possible duplicate of #51
I can sadly not replicate these shiny issues but since multiple people are reporting it I can only assume that it is a real issue in plumber2 or some platform specific issue. Can I get you to share your session info?
jimbrig commentedon Feb 20, 2026
@thomasp85 - same issue for me still. looking into it further.
jimbrig commentedon Apr 27, 2026
@thomasp85 - following up with some additional testing.
Good news: both
api_shiny()and the@shinyroxygen2 tag work correctly.What was tested
Both registration approaches work:
Both result in a fully functional Shiny session; the WebSocket handshake completes, inputs are initialized, and outputs render correctly.
A few findings worth noting below that may or may not be worth pursuing more, but thought I'd mention them:
Trailing slash on the access URL
Regardless of whether the path is registered as
/uior/ui/, the app only serves correctly when navigating to the trailing-slash URL in the browser (http://127.0.0.1:8080/ui/). This is expected behavior given how browsers resolve relative asset paths from an HTML document, not a routing bug, but it is easy to get wrong initially since its all silent, i.e. shiny routes don't appear in the OpenAPI__docs__interface, there's no auto-launch behavior for mounted apps, and the natural URL to try is whatever path string was passed toapi_shiny(), which without the slash fails silently even when provided a slash-less route (i.e. "/ui" vs "/ui/").A small quality-of-life improvement that would eliminate this entirely could be a startup message from
api_run()noting the correct access URL for each mounted Shiny app, e.g.:using the cli URL markup etc.
No routing changes needed, just surfacing the correct URL at run time would be enough
shinyAppDir()path resolutionRelative paths passed to
shinyAppDir()fail with! No Shiny application exists at the path "./app". Absolute paths work fine. This may be a working directory mismatch between the R session'sgetwd()and the directory containingplumber.Rbut may be worth investigating whether plumber2 should normalize the working directory when sourcing the file, or at minimum document that absolute paths are required.