Skip to content

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

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

Open
royfrancis opened this issue Apr 10, 2025 · 3 comments
Open

Comments

@royfrancis
Copy link

royfrancis commented Apr 10, 2025

Bug description

I get this error when running quarto render on a qmd file with shinylive chunk. This is a quarto document that used to work. Now coming back it after a year and running with newer version of tools, 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>

I am not really sure if the issue is shinylive quarto extension, shinylive, shinylive R package or something else altogether. Since quarto and the extension is my entry point, I decided to report it here.

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
Copy link
Author

royfrancis commented Apr 10, 2025

I went back to old docker container from a year ago and tried on the same qmd and it works. So I assume it's something to do with the newer version. The old versions that worked together were

quarto 1.4.549
shinylive-0.2.3
shinylive quarto extension 0.1.0
shinylive r version 0.1.1

@wch
Copy link
Collaborator

wch commented Apr 10, 2025

It looks like this is coming from the R shinylive package, and I just file an issue there: posit-dev/r-shinylive#150

@wch
Copy link
Collaborator

wch commented Apr 10, 2025

I am not able to reproduce this problem when I follow your exact instructions. One possibly significant difference is that I am not using Conda.

I also noticed that your log shows it downloading ragg and rbibutils. Mine doesn't try to download those.

Click to see output
❯ quarto render index.qmd      
pandoc 
  to: html
  output-file: index.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
  
ℹ Loading metadata database
✔ Loading metadata database ... done

trying URL 'http://repo.r-wasm.org/bin/emscripten/contrib/4.4/ggplot2_3.5.1.tgz'
Content type 'application/x-tar' length 4196030 bytes (4.0 MB)
==================================================
downloaded 4.0 MB

trying URL 'http://repo.r-wasm.org/bin/emscripten/contrib/4.4/colorspace_2.1-1.tgz'
Content type 'application/x-tar' length 2425563 bytes (2.3 MB)
==================================================
downloaded 2.3 MB

trying URL 'http://repo.r-wasm.org/bin/emscripten/contrib/4.4/fansi_1.0.6.tgz'
Content type 'application/x-tar' length 252633 bytes (246 KB)
==================================================
downloaded 246 KB

trying URL 'http://repo.r-wasm.org/bin/emscripten/contrib/4.4/farver_2.1.2.tgz'
Content type 'application/x-tar' length 1311148 bytes (1.3 MB)
==================================================
downloaded 1.3 MB

trying URL 'http://repo.r-wasm.org/bin/emscripten/contrib/4.4/gtable_0.3.6.tgz'
Content type 'application/x-tar' length 177854 bytes (173 KB)
==================================================
downloaded 173 KB

trying URL 'http://repo.r-wasm.org/bin/emscripten/contrib/4.4/isoband_0.2.7.tgz'
Content type 'application/x-tar' length 1611696 bytes (1.5 MB)
==================================================
downloaded 1.5 MB

trying URL 'http://repo.r-wasm.org/bin/emscripten/contrib/4.4/labeling_0.4.3.tgz'
Content type 'application/x-tar' length 40461 bytes (39 KB)
==================================================
downloaded 39 KB

trying URL 'http://repo.r-wasm.org/bin/emscripten/contrib/4.4/lattice_0.22-6.tgz'
Content type 'application/x-tar' length 927645 bytes (905 KB)
==================================================
downloaded 905 KB

trying URL 'http://repo.r-wasm.org/bin/emscripten/contrib/4.4/MASS_7.3-65.tgz'
Content type 'application/x-tar' length 851719 bytes (831 KB)
==================================================
downloaded 831 KB

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

trying URL 'http://repo.r-wasm.org/bin/emscripten/contrib/4.4/mgcv_1.9-1.tgz'
Content type 'application/x-tar' length 1561876 bytes (1.5 MB)
==================================================
downloaded 1.5 MB

trying URL 'http://repo.r-wasm.org/bin/emscripten/contrib/4.4/munsell_0.5.1.tgz'
Content type 'application/x-tar' length 223023 bytes (217 KB)
==================================================
downloaded 217 KB

trying URL 'http://repo.r-wasm.org/bin/emscripten/contrib/4.4/nlme_3.1-167.tgz'
Content type 'application/x-tar' length 1701826 bytes (1.6 MB)
==================================================
downloaded 1.6 MB

trying URL 'http://repo.r-wasm.org/bin/emscripten/contrib/4.4/pillar_1.10.1.tgz'
Content type 'application/x-tar' length 486641 bytes (475 KB)
==================================================
downloaded 475 KB

trying URL 'http://repo.r-wasm.org/bin/emscripten/contrib/4.4/pkgconfig_2.0.3.tgz'
Content type 'application/x-tar' length 16485 bytes (16 KB)
==================================================
downloaded 16 KB

trying URL 'http://repo.r-wasm.org/bin/emscripten/contrib/4.4/RColorBrewer_1.1-3.tgz'
Content type 'application/x-tar' length 25384 bytes (24 KB)
==================================================
downloaded 24 KB

trying URL 'http://repo.r-wasm.org/bin/emscripten/contrib/4.4/scales_1.3.0.tgz'
Content type 'application/x-tar' length 512986 bytes (500 KB)
==================================================
downloaded 500 KB

trying URL 'http://repo.r-wasm.org/bin/emscripten/contrib/4.4/tibble_3.2.1.tgz'
Content type 'application/x-tar' length 557365 bytes (544 KB)
==================================================
downloaded 544 KB

trying URL 'http://repo.r-wasm.org/bin/emscripten/contrib/4.4/utf8_1.2.4.tgz'
Content type 'application/x-tar' length 111761 bytes (109 KB)
==================================================
downloaded 109 KB

trying URL 'http://repo.r-wasm.org/bin/emscripten/contrib/4.4/vctrs_0.6.5.tgz'
Content type 'application/x-tar' length 928374 bytes (906 KB)
==================================================
downloaded 906 KB

trying URL 'http://repo.r-wasm.org/bin/emscripten/contrib/4.4/viridisLite_0.4.2.tgz'
Content type 'application/x-tar' length 1293388 bytes (1.2 MB)
==================================================
downloaded 1.2 MB

Warning messages:
1: In find.package(pkgs, lib.loc = NULL, quiet = FALSE, !is_quiet()) :
  there is no package called ‘palmerpenguins’
2: In find.package(pkgs, lib.loc = NULL, quiet = FALSE, !is_quiet()) :
  there is no package called ‘webr’
Output created: index.html

Here's some info for my system:

❯ 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.2 (2024-10-31)
Platform: aarch64-apple-darwin20
Running under: macOS Sequoia 15.3.2

Matrix products: default
BLAS:   /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/lib/libRblas.0.dylib 
LAPACK: /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/lib/libRlapack.dylib;  LAPACK version 3.12.0

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

time zone: America/Chicago
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.2

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

2 participants