Issue publishing shiny app to server

I can run my app fine in the local environment, but when I go to publish it to the server so others can view it I get the following error: " An error has occurred. The application failed to start. Contact the author for more information"

Looking further I get the following error on lines 36 and 38:
"Paths should be to files within the project directory"

The code on these lines is:
36. data <- read_excel("~/Cheese Pricing/T Version/Values for R/Cheese
Pricing 081021.xlsx") %>% filter(Date_of_Indication ==
max(Date_of_Indication))

  1. tportfolio <- read_excel("~/Cheese Pricing/T Version/Values for
    R/Portfolio for R 081021.xlsx")

Does anyone know how I can fix this?

Thanks

This evaluates to an absolute path, you should use relative paths instead (relative to the app's root folder) and all required files must be within the app's root folder.

2 Likes