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

Unable to render shinylive examples #57

Open
DivadNojnarg opened this issue Jul 29, 2024 · 3 comments
Open

Unable to render shinylive examples #57

DivadNojnarg opened this issue Jul 29, 2024 · 3 comments

Comments

@DivadNojnarg
Copy link
Collaborator

@christophsax: a summary of my investigations so far.

The shinyMobile blog post isn't rendering anymore on CICD and locally. Locally, the examples don't show any shinylive app but the code instead.

Screenshot 2024-07-29 at 22 44 42

What I have locally after updating shinylive R package (now):

shinylive::assets_info()
shinylive R package version: 0.2.0
shinylive web assets version: 0.5.0
...

When I render the qmd doc I get:

GET: /posts/2024-05-13-shinyMobile-2.0.0/index.html
  /posts/2024-05-13-shinyMobile-2.0.0/shinylive.js (404: Not Found)
GET: /posts/2024-05-13-shinyMobile-2.0.0/index.html
  /posts/2024-05-13-shinyMobile-2.0.0/shinylive.js (404: Not Found)

When shinylive is used with embed-resources: true, the original code chunk is shown in full instead of the shinylive app.

Weird because toggling this option does not change anything.

  • Besides, I locally tried with an older quarto version: 1.3.450. shinylive examples render but other errors appear.
  • Not a cache issue on CICD as this also fails locally.

All in all, this seems to be a collection of individual changes causing this issue: shinylive quarto extension, quarto, shinylive R package, ...


Extra remarks:

  • Our CICD workflow pulls the latest quarto: 1.6.x. Maybe we should fix it to always get predictable output.
@DivadNojnarg
Copy link
Collaborator Author

DivadNojnarg commented Jul 29, 2024

On a side note, with this new feature, we might not need the quarto shinylive extension anymore:

pak::pak("parmsam/r-shinylive@feat/encode-decode-url")
pak::pak("lzstring")

# Create a toy app in a folder and call shinylive:::url_encode_dir
shinylive:::url_encode_dir("APP_DIR")

# Which gives a ready to use URL to be embedded in an iframe.

https://shinylive.io/r/editor/#code=NobwRAdghgtgpmAXGKAHVA6ASmANGAYwHsIAXOMpMAGwEsAjAJykYE8AKAZwAtaJWAlAB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ABaXRBwgE1rF9Mh2EjKHSVhlQIfoF63u+N7MexrpenIQZwe7Cm+jgSFLBxYpwv0TJcYpdcCUpgy6u23cNUyYlYjgIK2KjHTHk5cMp2osBhdF8WTkHOXJcqTJYvi0KhcXEWxc1sqkrAEsDv0A6AF9vPNkQVDAc2AF0gA

@maelle
Copy link
Member

maelle commented Sep 24, 2024

Our CICD workflow pulls the latest quarto: 1.6.x. Maybe we should fix it to always get predictable output.

This makes perfect sense.

Are the errors for both render and preview?

@DivadNojnarg
Copy link
Collaborator Author

Are the errors for both render and preview?

Yes.

TBH I don't know what to think about the quarto shinylive extension. I am currently writing a new blog post but don't manage to render it. I now got this new kind of error for non CRAN packages, which complains about a mismatch between assets versions. The point is our custom wasm CRAN repo has packages with the correct tag versions: https://github.com/BristolMyersSquibb/webr-repos/blob/main/packages#L21, so I don't really get what's wrong (I am all up to date, cleared all the caches, reinstalled everything, ...)

Error in `get_github_wasm_assets()`:
! Can't find WebAssembly binary assets for
  github::BristolMyersSquibb/[email protected]
! Ensure WebAssembly binary assets are associated with the GitHub release
  "v0.0.2.9010".
ℹ WebAssembly binary assets can be built on release using GitHub Actions:
  <https://github.com/r-wasm/actions>
ℹ Alternatively, install a CRAN version of this package to use the default Wasm
  binary repository.
Backtrace:
     ▆
  1. └─shinylive:::quarto_ext()
  2.   └─shinylive:::build_app_resources(app_json)
  3.     ├─withr::with_options(...)
  4.     │ └─base::force(code)
  5.     └─shinylive:::download_wasm_packages(...)
  6.       └─base::lapply(...)
  7.         └─shinylive (local) FUN(X[[i]], ...)
  8.           └─shinylive:::prepare_wasm_metadata(pkg, prev_meta)
  9.             └─shinylive:::get_github_wasm_assets(desc)
 10.               └─cli::cli_abort(...)
 11.                 └─rlang::abort(...)
Warning message:
In find.package(pkgs, lib.loc = NULL, quiet = FALSE, !is_quiet()) :
  there is no package called ‘webr’
Execution halted
(E) Error running 'Rscript' command. Perhaps you need to install / update the 'shinylive' R package?

The irony is that it works perfectly from the shinylive app, no matter the tag version or whatever.

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

No branches or pull requests

2 participants