jhelvy / jhelvy/renderthis

Warning: A runtime exception has occured while executing JavaScript

Open
#46 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
HTML
Stars
178
Forks
13
PR merge metrics
No merged PRs in 30d

Description

Hello John,
Thank you so much for making xaringanBuilder. It has been a great help to me and my students. I am having a problem with it building a slide deck. Can I do anything to fix the warning/exception/problem shown below?

The issue:

Warning: A runtime exception has occured while executing JavaScript
  Runtime exception message:
    ReferenceError: $ is not defined
    at http://127.0.0.1:6101/X_files/kePrint-0.0.1/kePrint.js:1:1

The code

xaringanBuilder::build_pdf("./X.Rmd")

The Rmd file

---
title: "Bug"
output:
  xaringan::moon_reader
---

```{r packages}
suppressPackageStartupMessages(library(dplyr))
suppressPackageStartupMessages(library(kableExtra))
```


```{r, echo=FALSE}
datasets::anscombe %>% 
  select(x1, y1, x2, y2, x3, y3, x4, y4) %>% 
  kbl(col.names = rep(c("x", "y"), 4), align='c') %>% 
  add_header_above(c("Group 1" = 2, "Group 2" = 2, "Group 3" = 2, "Group 4" = 2))
```

Session info

─ Session info  🀦🏽  πŸ’ͺ🏻  πŸ•œ   ─────────────────────────────────────────────────────────────────────────────────────────────────
 hash: person facepalming: medium skin tone, flexed biceps: light skin tone, one-thirty

 setting  value
 version  R version 4.1.0 (2021-05-18)
 os       macOS Big Sur 11.6.2
 system   x86_64, darwin17.0
 ui       RStudio
 language (EN)
 collate  en_US.UTF-8
 ctype    en_US.UTF-8
 tz       America/New_York
 date     2022-01-05
 rstudio  2021.09.1+372 Ghost Orchid (desktop)
 pandoc   2.14.0.3 @ /Applications/RStudio.app/Contents/MacOS/pandoc/ (via rmarkdown)

─ Packages ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────
 package         * version date (UTC) lib source
 assertthat        0.2.1   2019-03-21 [1] CRAN (R 4.1.0)
 cachem            1.0.6   2021-08-19 [1] CRAN (R 4.1.0)
 callr             3.7.0   2021-04-20 [1] CRAN (R 4.1.0)
 cli               3.1.0   2021-10-27 [1] CRAN (R 4.1.0)
 colorspace        2.0-2   2021-06-24 [1] CRAN (R 4.1.0)
 crayon            1.4.2   2021-10-29 [1] CRAN (R 4.1.0)
 DBI               1.1.1   2021-01-15 [1] CRAN (R 4.1.0)
 desc              1.4.0   2021-09-28 [1] CRAN (R 4.1.0)
 devtools        * 2.4.3   2021-11-30 [1] CRAN (R 4.1.0)
 digest            0.6.29  2021-12-01 [1] CRAN (R 4.1.0)
 dplyr           * 1.0.7   2021-06-18 [1] CRAN (R 4.1.0)
 ellipsis          0.3.2   2021-04-29 [1] CRAN (R 4.1.0)
 evaluate          0.14    2019-05-28 [1] CRAN (R 4.1.0)
 fansi             0.5.0   2021-05-25 [1] CRAN (R 4.1.0)
 fastmap           1.1.0   2021-01-25 [1] CRAN (R 4.1.0)
 fs                1.5.2   2021-12-08 [1] CRAN (R 4.1.0)
 generics          0.1.1   2021-10-25 [1] CRAN (R 4.1.0)
 glue              1.6.0   2021-12-17 [1] CRAN (R 4.1.0)
 htmltools         0.5.2   2021-08-25 [1] CRAN (R 4.1.0)
 httr              1.4.2   2020-07-20 [1] CRAN (R 4.1.0)
 kableExtra      * 1.3.4   2021-02-20 [1] CRAN (R 4.1.0)
 knitr           * 1.37    2021-12-16 [1] CRAN (R 4.1.0)
 lifecycle         1.0.1   2021-09-24 [1] CRAN (R 4.1.0)
 magrittr          2.0.1   2020-11-17 [1] CRAN (R 4.1.0)
 memoise           2.0.1   2021-11-26 [1] CRAN (R 4.1.0)
 munsell           0.5.0   2018-06-12 [1] CRAN (R 4.1.0)
 pillar            1.6.4   2021-10-18 [1] CRAN (R 4.1.0)
 pkgbuild          1.2.1   2021-11-30 [1] CRAN (R 4.1.0)
 pkgconfig         2.0.3   2019-09-22 [1] CRAN (R 4.1.0)
 pkgload           1.2.4   2021-11-30 [1] CRAN (R 4.1.0)
 prettyunits       1.1.1   2020-01-24 [1] CRAN (R 4.1.0)
 processx          3.5.2   2021-04-30 [1] CRAN (R 4.1.0)
 ps                1.6.0   2021-02-28 [1] CRAN (R 4.1.0)
 purrr             0.3.4   2020-04-17 [1] CRAN (R 4.1.0)
 R6                2.5.1   2021-08-19 [1] CRAN (R 4.1.0)
 remotes           2.4.2   2021-11-30 [1] CRAN (R 4.1.0)
 rlang             0.4.12  2021-10-18 [1] CRAN (R 4.1.0)
 rmarkdown         2.11    2021-09-14 [1] CRAN (R 4.1.0)
 rprojroot         2.0.2   2020-11-15 [1] CRAN (R 4.1.0)
 rstudioapi        0.13    2020-11-12 [1] CRAN (R 4.1.0)
 rvest             1.0.2   2021-10-16 [1] CRAN (R 4.1.0)
 scales            1.1.1   2020-05-11 [1] CRAN (R 4.1.0)
 sessioninfo       1.2.1   2021-11-02 [1] CRAN (R 4.1.0)
 stringi           1.7.6   2021-11-29 [1] CRAN (R 4.1.0)
 stringr           1.4.0   2019-02-10 [1] CRAN (R 4.1.0)
 svglite           2.0.0   2021-02-20 [1] CRAN (R 4.1.0)
 systemfonts       1.0.3   2021-10-13 [1] CRAN (R 4.1.0)
 testthat        * 3.1.1   2021-12-03 [1] CRAN (R 4.1.0)
 tibble            3.1.6   2021-11-07 [1] CRAN (R 4.1.0)
 tidyselect        1.1.1   2021-04-30 [1] CRAN (R 4.1.0)
 usethis         * 2.1.3   2021-10-27 [1] CRAN (R 4.1.0)
 utf8              1.2.2   2021-07-24 [1] CRAN (R 4.1.0)
 vctrs             0.3.8   2021-04-29 [1] CRAN (R 4.1.0)
 viridisLite       0.4.0   2021-04-13 [1] CRAN (R 4.1.0)
 webshot           0.5.2   2019-11-22 [1] CRAN (R 4.1.0)
 withr             2.4.3   2021-11-30 [1] CRAN (R 4.1.0)
 xaringanBuilder * 0.0.9   2021-11-27 [1] Github (jhelvy/xaringanBuilder@235c8c4)
 xfun              0.29    2021-12-14 [1] CRAN (R 4.1.0)
 xml2              1.3.3   2021-11-30 [1] CRAN (R 4.1.0)

 [1] /Library/Frameworks/R.framework/Versions/4.1/Resources/library

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up β€” it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure with xaringanBuilder::build_pdf("./X.Rmd") using the provided Rmd example, then inspect the generated X_files/kePrint-0.0.1/kePrint.js referenced in the exception. Trace why $ is unavailable during rendering and verify that the example builds without a JavaScript runtime exception.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, r
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.