Error in value[[3L]](cond) : could not find function "%>%"

Hi everyone,

My app works locally (famous last word) but when I deploy I get the error:

Error in value[[3L]](cond) : could not find function "%>%"
Calls: local ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous>
Execution halted

I did start off by looking at other posts with the same error message but for different packages, and I've tried to debug this but am totally at a loss. I've structured my shiny app as a {golem} package and used usethis::use_pipe() and the log is pretty useless to help debug too:

2020-11-12T02:53:32.639238+00:00 shinyapps[3212711]: R version: 4.0.3
2020-11-12T02:53:32.639246+00:00 shinyapps[3212711]: shiny version: 1.5.0
2020-11-12T02:53:32.639280+00:00 shinyapps[3212711]: httpuv version: 1.5.4
2020-11-12T02:53:32.639288+00:00 shinyapps[3212711]: rmarkdown version: 2.5
2020-11-12T02:53:32.639358+00:00 shinyapps[3212711]: htmltools version: 0.5.0
2020-11-12T02:53:32.639521+00:00 shinyapps[3212711]: Using pandoc: /opt/connect/ext/pandoc2
2020-11-12T02:53:32.808128+00:00 shinyapps[3212711]: Using jsonlite for JSON processing
2020-11-12T02:53:32.811352+00:00 shinyapps[3212711]: 
2020-11-12T02:53:32.811353+00:00 shinyapps[3212711]: Starting R with process ID: '45'
2020-11-12T02:53:32.639292+00:00 shinyapps[3212711]: knitr version: 1.30
2020-11-12T02:53:32.639318+00:00 shinyapps[3212711]: jsonlite version: 1.7.1
2020-11-12T02:53:32.639326+00:00 shinyapps[3212711]: RJSONIO version: (none)
2020-11-12T02:53:33.150625+00:00 shinyapps[3212711]: Error in value[[3L]](cond) : could not find function "%>%"
2020-11-12T02:53:33.150627+00:00 shinyapps[3212711]: Calls: local ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous>
2020-11-12T02:53:33.150628+00:00 shinyapps[3212711]: Execution halted

The repo I am trying to deploy is here: https://github.com/Biogen-Inc/tidyCDISC, I've tried to create a reprex of a golem package with a pipe but of course that deployed just fine :woman_facepalming: any help or leads to explore this further would be incredibly helpful!

> version
               _                           
platform       x86_64-apple-darwin17.0     
arch           x86_64                      
os             darwin17.0                  
system         x86_64, darwin17.0          
status                                     
major          4                           
minor          0.3                         
year           2020                        
month          10                          
day            10                          
svn rev        79318                       
language       R                           
version.string R version 4.0.3 (2020-10-10)
nickname       Bunny-Wunnies Freak Out 

you app would need some mention of either magrittr or dplyr or tidyverse via library() or require() functions both so that rsconnect will understand you need that package available on the target system, but also to make it available without namespace declarations in your app code.

Thanks for your response, I tried explicitly adding library(magrittr) to the app.R file but this didn't work which confirms my mental model that using the golem infrastructure where we use pkgload::load_all should be loading that library already: https://github.com/Biogen-Inc/tidyCDISC/blob/master/app.R

I forgot to note that this app DID deploy just fine prior to updating my version of R (3.6.3) curious!

so your app is a package itself ?
perhaps it needs to have a library declaration to load itself so that rsconnect / shinyapps.io installs it as intended ?

Did it not work in exactly the same way as not having it didnt work, or in a new way?

Yup, same error, same log - if you're familiar with golem it's a framework to structure your shiny app as a package (which makes debugging this a little more complicated) thank you so much for your help and looking into this!

I recommend you look at this issue, and perhaps ifyour issue is different raise your own.

The issue is due to a different autoload behavior with Shiny 1.5.x.
See https://github.com/ThinkR-open/golem/issues/558#issuecomment-731175740