Shiny can't find image on Connect

I have a fairly silly problem, but I can't figure out the solution.

I have an image in my Shiny App, that I call using include_graphics("image.png"). It is saved in the same folder as my app. When I publish my Shiny App to Connect (using the publish button in RStudio), it recognizes that I want to include that image, and uploads it. However, the app then fails to launch on Connect, and instead displays an error message that it can't find the image. Any idea why this might be or how to resolve it? I've uploaded images with Shiny Apps before without any problems.

Figured out the solution by myself! For some reason, shiny can't handle apps with a space in the file name. Removing the space solved my problem.

Example: Rename My App to MyApp

1 Like

Well done digging into this issue here! Are you developing on a Windows computer? I suspect this may be a cross-platform issue, since Connect runs on linux. Generally, linux is a good bit more picky about file casing and spaces than its Windows counterpart :smile:

If spaces ever become important for you, I suspect there is a way to make it work. However, you are generally better off if you make a practice of avoiding spaces in filenames. They do create a fair amount of pain in linux land :sweat_smile:

I developed on a Windows computer but deployed on a Linux server, and I believe I still had the problem on the server. If that's the case, I'm sure it was just a leftover from developing on Windows computer. No need to add spaces, though! Just useful info to have. Thank you for your response and help.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.