ThinkR-open / golem

A Framework for Building Robust Shiny Apps
https://thinkr-open.github.io/golem/
Other
904 stars 132 forks source link

Using golem with renv causes an obscure error #557

Closed dwhdai closed 3 years ago

dwhdai commented 3 years ago

Hello!

When creating golem apps in an renv project, I get this weird error:

image

The only resolution is to delete the renv cache and reinstall the packages in the cache. Just wondering if anyone else has experienced this?

cderv commented 3 years ago

I think this is related: https://github.com/rstudio/renv/issues/455

dwhdai commented 3 years ago

I think this is related: rstudio/renv#455

Thanks for flagging that issue! Looks like it might be an renv issue then. I'll leave this open for visibility for others (in case mods think otherwise), as I've only experienced this issue when using renv in conjunction with golem.

jaredlander commented 3 years ago

Just experienced this myself. I deleted {golem} from the {renv} cache and that seemed to fix things. But I have no basis why it fixed anything or if that was really the problem anyway.

jaredlander commented 3 years ago

I take that back. After successfully loading one package, trying to load {shiny} failed still. This is getting more complicated.

jaredlander commented 3 years ago

Sorry for the scattershot comments, I'm just on the tailend of debugging this for about an hour. Some packages can be installed and loaded, others can't. So far {bs4Dash} works while {shiny} and {leaflet} don't. It's getting weirder.

dwhdai commented 3 years ago

@jaredlander what worked for me in the past was deleting the entire {renv} cache folder (location specific to your OS) and then re-installing everything with renv::restore(). It's time consuming... but at least it's a reproducible environment thanks to {renv}

jaredlander commented 3 years ago

I might be going down that road but wanted to help @kevinushey debug what's happening.

kevinushey commented 3 years ago

This is caused by a bug present in the CRAN release of golem but is currently fixed in the development version of golem. See https://github.com/rstudio/renv/issues/455 for my investigation.

I'd recommend updating golem on CRAN ASAP since currently this implies anyone trying to use golem + renv together risks corrupting their renv package cache.

jaredlander commented 3 years ago

Thanks @kevinushey for figuring it out. Tagging @ColinFay about updating CRAN.

ColinFay commented 3 years ago

Thank you all for this thread and thanks a lot to @kevinushey for the deep inspection.

The new version of {golem} should be on the CRAN soon, I'm doing a last round up of issue solving right now and will send it to CRAN whenever this version is stable.

Cheers, Colin

ColinFay commented 3 years ago

Hey y'all,

I'm sorry it took so long for pushing the new version to CRAN.

The new version (0.3.1) has been available for two weeks now, feel free to update :)

I'm going to close this now, if ever you still encounter this issue after an update, please leave a comment below so that I can reopen it.

Cheers,

Colin