-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resources in www aren't served when shinyApp()
is print()
ed or passed to runApp()
#3742
Comments
Interesting! To be clear, this doesn't appear to be a problem without the |
shinyApp()
is print()
ed
Ah. So actually the issue persists even without the explicit In fact, the purpose of the explicit |
For completeness, using runApp(shinyApp(ui, server)) |
shinyApp()
is print()
edshinyApp()
is print()
ed or passed to runApp()
So far my understanding of this matter was, that the |
@ismirsehregal But you can’t use |
@klmr as already stated on SO I absolutely agree. Either the documentation or the default implementation of the resource publishing via |
System details
Output of
sessionInfo()
:Example application or steps to reproduce the problem
With the following working directory:
Describe the problem in detail
Running this Shiny app results in a page that shows only a placeholder icon. The image URL returns a 404 HTTP status. The image is a valid PNG file with read permissions, and Shiny can successfully serve this file by adding an explicit resource handler via
addResourcePath('prefix', file.path(getwd(), 'www'))
.How the Shiny app is run does not matter; none of the following options works:
app.r
app.r
file)Rscript app.r
The issue exists across operating systems (Linux, Windows) and R versions, and at least with both Shiny 1.7.2 and Shiny 1.7.3.
Some (but not all!) other people can see the file when running the minimal example above. This indicates some machine-specific configuration, but I’m at a loss how to find it.
When intercepting
shiny:::staticHandler
calls I can see that the function is called once while constructing the Shiny app object and then repeatedly when loading the app:sys.www.root
(i.e.system_file('www', package='shiny')
)LIBPATH/shiny/www/shared
LIBPATH/shiny/www/shared/bootstrap
)… but never for the app’s
www
directory. Based on this I believe that there is fundamentally no chance that the resource/test.png
could ever be served by my minimal Shiny app, despite the fact that it works for other people on their systems. And the documentation states thatSo this should work.
The text was updated successfully, but these errors were encountered: