简体   繁体   中英

Shiny app fails at reading packages: The application failed to start (exited with code 1)

I can deploy my Shiny app locally, but when I try to deploy it in shinyapps.io, the application fails to start

I've already checked a lot of issues and similar questions but none of the answers worked for me. I don't include install.packages() or setwd() lines in my code.

My shiny app uses the following libraries:

library(shiny)
library(RColorBrewer)
library(data.table)
library(sf)
library(ggmap)
library(osmdata)
library(rsconnect)
library(tidyverse)

And I get this error message in the shiny apps url when I try to deploy it:

An error has occurred
The application failed to start (exited with code 1).

Error in value[[3L]](cond) : there is no package called ‘RColorBrewer’
Calls: local ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous>
Execution halted

And this error in the RStudio IDE:

Preparing to deploy application...DONE
Uploading bundle for application: 1454528...DONE
Deploying bundle: 2581070 for application: 1454528 ...
Waiting for task: 666404305
  building: Processing bundle: 2581070
  building: Installing packages
  building: Installing files
  building: Pushing image: 2799820
  deploying: Starting instances
  terminating: Stopping old instances
Application successfully deployed to https://racofernandez.shinyapps.io/superficie-deptos-caba/
Deployment completed: https://racofernandez.shinyapps.io/superficie-deptos-caba/
Warning message:
In fileDependencies.R(file) :
  Failed to parse C:/Users/rama_/AppData/Local/Temp/Rtmp63cnOU/file3b2c779a2a37/app.R ; dependencies in this file will not be discovered.

Any suggestions? Thanks!

The issue was generated by special characters like "ñ" included in my script, as showed in this question: Error in Shiny deployment on shinyapps.io

Welcome on SO!

Your error log prints:

Failed to parse C:/Users/rama_/AppData/Local/Temp/Rtmp63cnOU/file3b2c779a2a37/app.R; dependencies in this file will not be discovered.

shinyapps.io detects dependencies by parsing the R files, and detects the packages needed.

Here, shinyapps could not parse the app.R file, so couldn't detect which packages are needed.

You might want to try packrat::init() locally to detect the error.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM