Closed akgold closed 3 years ago
Nice idea — can you please point me to docs for R_CONFIG_ACTIVE
just so I can track in a comment?
Actually, I think I'll just make "auto" a bit smarter, and give a more informative error if it fails:
#> Error: auth = `auto` has failed to find way to authenticate
#> * Can't find CONNECT_SERVER and CONNECT_API_KEY envvars for `auth = 'envvar'`
#> * Can't find any rsconnect::accounts() for `auth = 'rsconnect'`
This issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue.
Newer versions of RSC (>= 1.8.8) make
CONNECT_SERVER
andCONNECT_API_KEY
automatically available in the environment.When a document that includes
board_rsconnect()
is deployed to an earlier version of RSC, the result is that theboard_rsconnect()
attempts to usersconnect
auth and it yields an error that thersconnect
package isn't found, probably sending people down a weird rabbithole.It would be really helpful if
board_rsconnect
could detect if it were on RSC (R_CONFIG_ACTIVE
env var is set automatically) and then forceenvvar
auth, perhaps throwing a helpful error if the env vars aren't detected.Maybe something like: "RStudio Connect 1.8.8 and newer automatically provide the environment variables
CONNECT_SERVER
andCONNECT_API_KEY
. Upgrade or provide those variables manually in the environment variables pane."