Skip to content

Issue with Leaflet's addPolygons in bs4_book #1491

Open
@jmhatch

Description

@jmhatch

I have a leaflet map inside of a bs4_book that I'm rendering using bookdown. I've noticed that when I add 2+ (number can be different depending on data) addPolygons() to the leaflet map I get the following error message,

Tweaking _book/index.html
Error in if (xml2::xml_attr(parent, "class") == "row") { :
missing value where TRUE/FALSE needed
Please delete _main.Rmd after you finish debugging the error.

I can render this map in the browser or in RStudio's Viewer tab just fine. If the number of addPolyons() is less than 2, it'll render.

I try to render the book by running the following in the directory of the index.Rmd files, provided in the mwe.zip,

bookdown::render_book('index.Rmd', 'all')

Session info (but also fails in GH action when I install most recent packages):

R version 4.4.2 (2024-10-31 ucrt)
Platform: x86_64-w64-mingw32/x64
Running under: Windows 10 x64 (build 19045), RStudio 2023.12.1.402

Locale:
LC_COLLATE=English_United States.utf8 LC_CTYPE=English_United States.utf8
LC_MONETARY=English_United States.utf8 LC_NUMERIC=C
LC_TIME=English_United States.utf8

Package version:
base64enc_0.1.3 bookdown_0.41 bslib_0.9.0 cachem_1.1.0 cli_3.6.3
digest_0.6.37 evaluate_1.0.3 fastmap_1.2.0 fontawesome_0.5.3 fs_1.6.5
glue_1.8.0 graphics_4.4.2 grDevices_4.4.2 highr_0.11 htmltools_0.5.8.1
jquerylib_0.1.4 jsonlite_1.9.0 knitr_1.49 lifecycle_1.0.4 memoise_2.0.1
methods_4.4.2 mime_0.12 R6_2.6.1 rappdirs_0.3.3 rlang_1.1.4
rmarkdown_2.29 sass_0.4.9 stats_4.4.2 tinytex_0.55 tools_4.4.2
utils_4.4.2 xfun_0.51 yaml_2.3.10

Checklist

When filing a bug report, please check the boxes below to confirm that you have provided us with the information we need. Have you:

  • formatted your issue so it is easier for us to read?

  • included a minimal, self-contained, and reproducible example?

  • pasted the output from xfun::session_info('bookdown') in your issue?

  • upgraded all your packages to their latest versions (including your versions of R, the RStudio IDE, and relevant R packages)?

  • installed and tested your bug with the development version of the bookdown package using remotes::install_github("rstudio/bookdown") ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions