Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When following the shinylive tutorial you currently get a blank page when previewing static server #121

Closed
StefKirsch opened this issue Aug 14, 2024 · 6 comments

Comments

@StefKirsch
Copy link

StefKirsch commented Aug 14, 2024

I've been playing around with this tutorial today. When I follow it in RStudio locally, I am getting a blank page as soon as I run

httpuv::runStaticServer("site/")

I installed the development version of shinylive as indicated. But I get the same result when I use the stable version 0.2.0 from CRAN.

The only way that I tried and got it to work was downgrading to version 0.1.1 and rebuilding the site.

I built out everything in this repository to reproduce the issue. I might add another branch with site builds with different shinylive versions.

@virtualinertia
Copy link

Same experience on Posit Cloud.

The shinylive::export("shiny_app_dir", "site_dir") command fails for me.

It builds a static website structure with apparently broken javascript.

This is a simple Shiny app that works on Posit Cloud and works for everyone when deployed to shinyapp.io at https://323kwp-alex-karman.shinyapps.io/nld_data_catalog/ .

It is a very simple app with only four files in it, you can clone it from my public github repo at https://github.com/virtualinertia/nld_data_catalog_shiny .

But when I try to convert it by running shinylive::export("nld_data_catalog", "site") it produces a static website in a "site" directory that does not work. The browser freezes. This happens in Posit Cloud but also when I download it and try to run it locally by loading index.html.

@gadenbuie
Copy link
Contributor

@StefKirsch were you also trying to view the app using Posit Cloud? Or were you having trouble locally?

@StefKirsch
Copy link
Author

@StefKirsch were you also trying to view the app using Posit Cloud? Or were you having trouble locally?

I'm working locally in RStudio. I updated my comment to reflect that. 😊

@gadenbuie
Copy link
Contributor

gadenbuie commented Aug 15, 2024

The only way that I tried and git it to work was downgrading to version 0.1.1 and rebuilding the site.

I think this might be an indication that your browser has cached parts of the old version of the site and that when you're trying it with the new version of shinylive it might be using some of those cached assets instead of the newer ones.

Try refreshing your browser on the page with the shinylive app. Sometimes you need to do a "hard refresh" (how to do that depends on your browser and operating system).

@StefKirsch
Copy link
Author

The only way that I tried and git it to work was downgrading to version 0.1.1 and rebuilding the site.

I think this might be an indication that your browser has cached parts of the old version of the site and that when you're trying it with the new version of shinylive it might be using some of those cached assets instead of the newer ones.

Try refreshing your browser on the page with the shinylive app. Sometimes you need to do a "hard refresh" (how to do that depends on your browser and operating system).

Awesome, clearing the cached files indeed solves the issue! 🎉 Thanks a lot!

@gadenbuie gadenbuie pinned this issue Aug 15, 2024
@georgestagg
Copy link
Collaborator

Following up on a conversation with @gadenbuie at posit::conf(). We need to improve the failure mode when the Shinylive JS Service Worker fails to load. I've opened an issue about that here: posit-dev/shinylive#171

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants