Skip to content

Error in desc$Repository : $ operator is invalid for atomic vectors #228

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

Closed
royfrancis opened this issue Apr 10, 2025 · 1 comment
Closed
Labels
s: triage-needed New bug report that needs to be classified. t: bug Something isn't working

Comments

@royfrancis
Copy link

Bug description

I get this error when running quarto render on a qmd file with shinylive chunk. I think the error only occurs if the shinylive chunk installs webr packages (webr::install("ggplot2")). This is a quarto document that used to work. Now coming back it a few months later, it gives this error.

When I run quarto render index.qmd

trying URL 'http://repo.r-wasm.org/bin/emscripten/contrib/4.4/ragg_1.3.3.tgz'
Content type 'application/x-tar' length 692282 bytes (676 KB)
==================================================
downloaded 676 KB

trying URL 'http://repo.r-wasm.org/bin/emscripten/contrib/4.4/rbibutils_2.3.tgz'
Content type 'application/x-tar' length 1056089 bytes (1.0 MB)
==================================================
downloaded 1.0 MB

Error in desc$Repository : $ operator is invalid for atomic vectors
Calls: <Anonymous> ... download_wasm_packages -> lapply -> FUN -> prepare_wasm_metadata
In addition: There were 12 warnings (use warnings() to see them)
Execution halted
(E) Error running 'Rscript' command. Perhaps you need to install / update the 'shinylive' R package?
 Error:
 pandoc.pipe.error {command: "Rscript", error_code: 1, output: ""}
Error running filter /Applications/quarto/share/filters/main.lua:
...shinylive/_extensions/quarto-ext/shinylive/shinylive.lua:40: Error running 'Rscript' command. Perhaps you need to install / update the 'shinylive' R package?

stack traceback:
	...shinylive/_extensions/quarto-ext/shinylive/shinylive.lua:40: in global 'throw_quarto_error'
	...shinylive/_extensions/quarto-ext/shinylive/shinylive.lua:86: in global 'callRShinylive'
	...shinylive/_extensions/quarto-ext/shinylive/shinylive.lua:113: in global 'callShinylive'
	...shinylive/_extensions/quarto-ext/shinylive/shinylive.lua:437: in function <...shinylive/_extensions/quarto-ext/shinylive/shinylive.lua:408>
	[C]: in ?
	[C]: in method 'walk'
	/Applications/quarto/share/filters/main.lua:558: in local 'checked_walk'
	/Applications/quarto/share/filters/main.lua:610: in function 'run_emulated_filter'
	/Applications/quarto/share/filters/main.lua:1297: in local 'callback'
	[string "..."]:1888: in field 'withScriptFile'
	/Applications/quarto/share/filters/main.lua:1313: in upvalue 'run_emulated_filter_chain'
	/Applications/quarto/share/filters/main.lua:1351: in function </Applications/quarto/share/filters/main.lua:1348>
stack traceback:
	/Applications/quarto/share/filters/main.lua:558: in local 'checked_walk'
	/Applications/quarto/share/filters/main.lua:610: in function 'run_emulated_filter'
	/Applications/quarto/share/filters/main.lua:1297: in local 'callback'
	[string "..."]:1888: in field 'withScriptFile'
	/Applications/quarto/share/filters/main.lua:1313: in upvalue 'run_emulated_filter_chain'
	/Applications/quarto/share/filters/main.lua:1351: in function </Applications/quarto/share/filters/main.lua:1348>

Steps to reproduce

This is my directory setup:

.
|-- _extensions
|   `-- quarto-ext
|       `-- shinylive
`-- index.qmd

Here is the index.qmd file:

---
title: "Shinylive"
format: html
filters:
  - shinylive
---

```{shinylive-r}
#| standalone: true
#| viewerHeight: 450

webr::install(c("ggplot2", "bslib", "palmerpenguins", "htmltools"))

library(htmltools)
library(bslib)
library(ggplot2)
library(palmerpenguins)
data("penguins")

pdata <- na.omit(penguins)
pc <- prcomp(pdata[,c("bill_length_mm", "bill_depth_mm", "flipper_length_mm", "body_mass_g")], center = TRUE, scale. = TRUE)
dfr <- cbind(pdata,as.data.frame(pc$x))

ui <- page_sidebar(
  sidebar = sidebar(
    selectInput("x",
      label = "X axis",
      choices = c("PC1","PC2","PC3","PC4"),
      selected = "PC1"
    ),

    selectInput("y",
      label = "Y axis",
      choices = c("PC1","PC2","PC3","PC4"),
      selected = "PC2"
    ),
    selectInput("v",
      label = "Color",
      choices = c("species", "island", "sex"),
      selected = "cut"
    )
  ),
  imageOutput("plot", height = "350px")
)

server <- function(input, output, session) {

  output$plot <- renderImage({
    x <- input$x
    y <- input$y
    v <- input$v

    p <- ggplot(dfr, aes(x = !!sym(x), y = !!sym(y), col = !!sym(v))) +
      geom_point() +
      theme_bw() +
      theme(legend.position = "top")

    file <- htmltools::capturePlot(
      print(p),
      tempfile(fileext = ".svg"),
      grDevices::svg,
      width = 4,
      height = 4
    )

    list(src = file)
  }, deleteFile = TRUE)
}

app <- shinyApp(ui = ui, server = server)
```

Your environment

System Version: macOS 15.4 (24E248)
Kernel Version: Darwin 24.4.0

$ quarto list extensions
Id                      Version    Contributes
quarto-ext/shinylive    0.2.0      filters

$ Rscript -e "packageVersion('shinylive')"
[1] '0.3.0.9000'

$ Rscript -e "sessionInfo()"
R version 4.4.1 (2024-06-14)
Platform: x86_64-apple-darwin13.4.0
Running under: macOS Big Sur ... 10.16

Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /opt/homebrew/Caskroom/miniforge/base/envs/r-4.4/lib/liblapack-netlib.3.9.0.dylib

locale:
[1] C

time zone: Europe/Stockholm
tzcode source: internal

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

loaded via a namespace (and not attached):
[1] compiler_4.4.1

The versions mentioned above are when running in a conda environment on Mac. I have also tried this in an ubuntu docker container and get the same error.

Quarto check output

Quarto 1.6.42
[✓] Checking environment information...
Quarto cache location: /Users/royfr474/Library/Caches/quarto
[✓] Checking versions of quarto binary dependencies...
Pandoc version 3.4.0: OK
Dart Sass version 1.70.0: OK
Deno version 1.46.3: OK
Typst version 0.11.0: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
Version: 1.6.42
Path: /Applications/quarto/bin

[✓] Checking tools....................OK
TinyTeX: (external install)
Chromium: (not installed)

[✓] Checking LaTeX....................OK
Using: TinyTex
Path: /Users/royfr474/Library/TinyTeX/bin/universal-darwin
Version: 2024

[✓] Checking basic markdown render....OK

[✓] Checking Python 3 installation....OK
Version: 3.9.18 (Conda)
Path: /opt/homebrew/Caskroom/miniforge/base/envs/r-4.4/bin/python
Jupyter: 5.7.1
Kernels: python3

[✓] Checking Jupyter engine render....OK

[✓] Checking R installation...........OK
Version: 4.4.1
Path: /opt/homebrew/Caskroom/miniforge/base/envs/r-4.4/lib/R
LibPaths:
- /opt/homebrew/Caskroom/miniforge/base/envs/r-4.4/lib/R/library
knitr: 1.49
rmarkdown: 2.29

[✓] Checking Knitr engine render......OK

@royfrancis royfrancis added s: triage-needed New bug report that needs to be classified. t: bug Something isn't working labels Apr 10, 2025
@royfrancis
Copy link
Author

Accidentally posted in the wrong repo. Reposted to quarto-ext/shinylive#70

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
s: triage-needed New bug report that needs to be classified. t: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant