Issue
Images fail to display in a deployed Shiny application on shinyapps.io, even when image references in the code appear correct.
Description
This typically occurs when image files are not properly included in the deployment bundle during publishing. In ShinyApps.io, only files inside the app directory — especially within the www/
folder — are automatically included during deployment. If the image isn’t placed there, it won’t be bundled and will not display at runtime.
💡 Why this happens:
When you deploy to shinyapps.io, only files inside your app directory, including the www/
folder — are bundled and uploaded. If the image isn’t placed in that folder, it won’t be included and therefore can’t be found when the app is live.
Solution
To resolve this issue:
- Create a folder named
www
in your Shiny app's root directory if it doesn't already exist - Place all image files that your app references inside the
www
folder - When referencing images in your UI code, use just the filename (e.g.,
"logo.png"
), without includingwww/
in the path, Shiny automatically serves files from that folder.
Example code:
ui <- fluidpage(="fluidPage(" img(src="image.png" ,="," height="80px" )=")">
When publishing your app:
- Click the 'Publish' button in RStudio
- In the deployment preview window, verify that the
www
folder and your image files are listed in the files to be deployed - Complete the publishing process
Your images should now display correctly in the published application.
Still not working?
If the image still doesn’t appear after following the steps above, please ensure:
- The image filename is spelled correctly (case-sensitive)
- The image file is listed in the “Files to deploy” dialog in RStudio
- You can access the file directly via URL (e.g.,
https://your-app.shinyapps.io/www/image.png
)
If you're still having issues, you can reach out to Support by opening a ticket here.
Comments
0 comments
Article is closed for comments.