Open kv9898 opened 3 weeks ago
Strangely, while rendering from the Quarto CLI works fine for both R and Python, in RStudio I got an error of:
Error running 'shinylive' command. Perhaps you need to install / update the 'shinylive' Python package?
Seems that RStudio executes the filter in a different way than the CLI.
A reprex:
---
title: "Shinylive Python test"
filters:
- shinylive
---
```{shinylive-python}
#| standalone: true
I wonder if this is similar to an issue I'm having. I'm trying to use Python shinylive extension. I've followed similar steps as you have, though I'm using VSCode and Codespaces.
The Quarto site runs, the shinylive editor renders while the viewer loads, but then the viewer can't load and collapses the whole Shinylive block into a gray line. My Edge browser console says:
Uncaught Error: ServiceWorker controller was not found! at setupAppProxyPath (shinylive.js:35071:11)
Hi there. In my case, the site wouldn't run at all, so I guess you are experiencing a separate problem. Your experience sounds like this issue below, maybe checking that one out is useful!
kv9898, thank you for the link! Yes, #133 is the issue I'm having. I'm not sure how I missed it when looking in Issues.
Best of luck with your challenge above.
kv9898, thank you for the link! Yes, #133 is the issue I'm having. I'm not sure how I missed it when looking in Issues.
Best of luck with your challenge above.
You're welcome! There are quite a lot of 'shinylive' repos out there, haha. This repo is for the quarto extension only, while the link I shared with you belongs to the 'main' repo. There are also another 2 'shinylive' repos for the R and Python packages, respectively.
@cscheid Any suggestions on how to call Rscript
properly? Thank you in advance!
Quarto does this:
It strikes me that this is such a complicated dance that Quarto should probably make the result of this call available to Lua filters.
@schloerke
The PR is merged, and the quarto.paths.rscript()
API entry point will be available starting in Quarto 1.6.23. (Since your extension will probably have to support Quarto 1.5 for a while, you will need to check for the presence of the quarto.paths
table.)
Thank you @cscheid !
I was asked to file it here by the Quarto team (https://github.com/quarto-dev/quarto/issues/557).
System details:
Windows 11 64-bit
Version details:
Positron Version: 2024.09.0 (system setup) build 77 Code - OSS Version: 1.93.0 Date: 2024-09-23T02:44:07.418Z Electron: 30.4.0 Chromium: 124.0.6367.243 Node.js: 20.15.1 V8: 12.4.254.20-electron.0 OS: Windows_NT x64 10.0.22631
Quarto: 1.6.15 shinylive (R package): 0.2.0
Interpreter details:
R 4.4.1
Describe the issue:
Seems to be a Windows only issue.
In a nutshell, without R in PATH for Windows:
Steps to reproduce the issue:
quarto add quarto-ext/shinylive
in Terminal to install the Quarto extension.install.packages("shinylive")
if it has not been installed before.==> quarto preview shinyliver.qmd --to default --no-watch-inputs --no-browse
pandoc to: html output-file: shinyliver.html standalone: true section-divs: true html-math-method: mathjax wrap: none default-image-extension: png
metadata document-css: false link-citations: true date-format: long lang: en title: Shinylive R test
ℹ Loading metadata database ✔ Loading metadata database ... done
Output created: shinyliver.html
Watching files for changes Browse at http://localhost:5239/
PS D:\OneDrive - London School of Economics\Desktop\shinyliveRError> quarto preview "d:/OneDrive - London School of Economics/Desktop/shinyliveRError/shinyliver.qmd" --no-browser --no-watch-inputs pandoc to: html output-file: shinyliver.html standalone: true section-divs: true html-math-method: mathjax wrap: none default-image-extension: png
metadata document-css: false link-citations: true date-format: long lang: en title: Shinylive R test
(E) Error running 'Rscript' command. Perhaps you need to install / update the 'shinylive' R package? Error: PandocError {} Error running filter D:/quarto/share/filters/main.lua: ...iveRError_extensions\quarto-ext\shinylive\shinylive.lua:40: Error running 'Rscript' command. Perhaps you need to install / update the 'shinylive' R package?
stack traceback: ...iveRError_extensions\quarto-ext\shinylive\shinylive.lua:40: in global 'throw_quarto_error' ...iveRError_extensions\quarto-ext\shinylive\shinylive.lua:86: in global 'callRShinylive' ...iveRError_extensions\quarto-ext\shinylive\shinylive.lua:113: in global 'callShinylive' ...iveRError_extensions\quarto-ext\shinylive\shinylive.lua:286: in global 'ensureBaseSetup' ...iveRError_extensions\quarto-ext\shinylive\shinylive.lua:315: in global 'ensureLanguageSetup' ...iveRError_extensions\quarto-ext\shinylive\shinylive.lua:424: in function <...iveRError_extensions\quarto-ext\shinylive\shinylive.lua:408>
[C]: in ? [C]: in method 'walk' D:/quarto/share/filters/main.lua:558: in local 'checked_walk' D:/quarto/share/filters/main.lua:610: in function 'run_emulated_filter' D:/quarto/share/filters/main.lua:1335: in local 'callback' [string "..."]:1888: in field 'withScriptFile' D:/quarto/share/filters/main.lua:1351: in upvalue 'run_emulated_filter_chain' D:/quarto/share/filters/main.lua:1389: in function <D:/quarto/share/filters/main.lua:1386> stack traceback: D:/quarto/share/filters/main.lua:558: in local 'checked_walk' D:/quarto/share/filters/main.lua:610: in function 'run_emulated_filter' D:/quarto/share/filters/main.lua:1335: in local 'callback' [string "..."]:1888: in field 'withScriptFile' D:/quarto/share/filters/main.lua:1351: in upvalue 'run_emulated_filter_chain' D:/quarto/share/filters/main.lua:1389: in function <D:/quarto/share/filters/main.lua:1386>