Update:
The error is occuring specifically when the shiny app tries to add the shinyalert pop-up, which has three elements (this is what the length = 3 refers to in the error). If I remove the HTML line, the error changes to length = 2 and If I omit all of the below lines I don't get the error (but they are needed for the rest of the app to work):
observeEvent(input$map_click, {
shinyalert(html = TRUE, showConfirmButton = F,
text = tagList(HTML(paste0("Proposition :<br>")),
textInput("prop", ""),
actionButton("enter", "Valider")))
})
I am therefore reasonably sure that it is the shinyalert package which is at issue and the if statement relates to whether the map was clicked or not.
I am developing a shiny app to allow users to drop-pin on a map and label the points, then export them in a .csv. The app was already described in this post and a working solution was provided for my original problem.
However, when I try to run the solution having recently upgraded R to 4.3.0 (and updated the required packages), I get the following error:
Warning: Error in &&: 'length = 3' in coercion to 'logical(1)'
3: runApp
2: print.shiny.appobj
1: <Anonymous>
The error occurs when I try to click on the map in the shiny app to register a GPS point.
I have read a few other posts and github issues on this error, and as far as I understand, it is a recent change in base R (I think) which is having the knock-on effect of generating this error under certain circumstances in multiple r packages.
However, I have not been able to find a list of the affected packages, so don't know which of the ones I am using here is throwing the error. I have seen posts (with no responses yet) with this error for other shiny apps, so it could be shiny itself, but I'm not sure and don't know how to isolate it.
I also don't understand what the error means or how to fix it. Can anyone help?
Here is my session info:
> sessionInfo()
R version 4.3.0 (2023-04-21 ucrt)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19045)
Matrix products: default
locale:
[1] LC_COLLATE=English_United Kingdom.utf8 LC_CTYPE=English_United Kingdom.utf8
[3] LC_MONETARY=English_United Kingdom.utf8 LC_NUMERIC=C
[5] LC_TIME=English_United Kingdom.utf8
time zone: Europe/London
tzcode source: internal
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] sf_1.0-12 dplyr_1.1.2 rio_0.5.29 here_1.0.1 pacman_0.5.1
[6] leaflet_2.1.2 DT_0.28 shinyalert_3.0.0 shiny_1.7.4
loaded via a namespace (and not attached):
[1] xfun_0.39 bslib_0.4.2 htmlwidgets_1.6.2 vctrs_0.6.2
[5] tools_4.3.0 crosstalk_1.2.0 generics_0.1.3 curl_5.0.0
[9] tibble_3.2.1 proxy_0.4-27 fansi_1.0.4 pkgconfig_2.0.3
[13] KernSmooth_2.23-20 data.table_1.14.8 checkmate_2.2.0 readxl_1.4.2
[17] uuid_1.1-0 lifecycle_1.0.3 compiler_4.3.0 fontawesome_0.5.1
[21] httpuv_1.6.9 htmltools_0.5.5 class_7.3-21 sass_0.4.6
[25] yaml_2.3.7 later_1.3.0 pillar_1.9.0 crayon_1.5.2
[29] jquerylib_0.1.4 ellipsis_0.3.2 classInt_0.4-9 cachem_1.0.8
[33] mime_0.12 zip_2.3.0 tidyselect_1.2.0 shinydisconnect_0.1.0
[37] digest_0.6.31 stringi_1.7.12 colourpicker_1.2.0 forcats_1.0.0
[41] rprojroot_2.0.3 fastmap_1.1.1 grid_4.3.0 cli_3.6.1
[45] magrittr_2.0.3 utf8_1.2.3 e1071_1.7-13 foreign_0.8-84
[49] withr_2.5.0 promises_1.2.0.1 backports_1.4.1 cellranger_1.1.0
[53] hms_1.1.3 openxlsx_4.2.5.2 memoise_2.0.1 knitr_1.42
[57] haven_2.5.2 miniUI_0.1.1.1 rlang_1.1.0 Rcpp_1.0.10
[61] xtable_1.8-4 glue_1.6.2 DBI_1.1.3 rstudioapi_0.14
[65] jsonlite_1.8.4 R6_2.5.1 units_0.8-1