Skip to content
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

Causes javascript error #12

Open
marcusyoung opened this issue Nov 11, 2021 · 5 comments
Open

Causes javascript error #12

marcusyoung opened this issue Nov 11, 2021 · 5 comments

Comments

@marcusyoung
Copy link

Was just trying the package on one of my apps and got this error showing in the browser console. Impact on the app is a ggplot not appearing.

Uncaught TypeError: event.binding is undefined
    <anonymous> line 2 > injectedScript:160
    jQuery 7
    value shinyapp.ts:556
    value shinyapp.ts:736
    value shinyapp.ts:717
    value shinyapp.ts:700
    onmessage shinyapp.ts:350
    value shinyapp.ts:349
    value shinyapp.ts:277
    vy init.ts:425
    gy index.ts:56
    setTimeout handler*gy/< index.ts:55
    jQuery 13
        e
        t
        setTimeout handler*l/<
        c
        fireWith
        fire
        c
        fireWith
        ready
        B
        EventListener.handleEvent*
        <anonymous>
        <anonymous>

Location of error:

2021-11-11_11-08-49

@pvictor
Copy link
Member

pvictor commented Nov 12, 2021

Hello,
Can you share the code producing the error ?
Or your sessioninfo::session_info() ?
Thanks

@marcusyoung
Copy link
Author

I can't share the code, but it's just a renderPlot() which outputs a ggplot2 object that's been returned by a function. There's nothing unusual about it.

Here is the session info:

 sessioninfo::session_info()
- Session info  -------------------------------------------------------------------------
 hash: person climbing: light skin tone, control knobs, palms up together: dark skin tone

 setting  value
 version  R version 4.1.1 (2021-08-10)
 os       Windows 10 x64 (build 19043)
 system   x86_64, mingw32
 ui       RStudio
 language (EN)
 collate  English_United Kingdom.1252
 ctype    English_United Kingdom.1252
 tz       Europe/London
 date     2021-11-12
 rstudio  2021.09.0+351 Ghost Orchid (desktop)
 pandoc   2.11.3.2 @ C:\\PROGRA~1\\Pandoc\\pandoc.exe

- Packages ------------------------------------------------------------------------------
 package      * version date (UTC) lib source
 anytime        0.3.9   2020-08-27 [1] CRAN (R 4.1.1)
 assertthat     0.2.1   2019-03-21 [1] CRAN (R 4.0.0)
 bit            4.0.4   2020-08-04 [1] CRAN (R 4.0.2)
 bit64          4.0.5   2020-08-30 [1] CRAN (R 4.0.2)
 blob           1.2.2   2021-07-23 [1] CRAN (R 4.1.1)
 bslib          0.3.1   2021-10-06 [1] CRAN (R 4.1.1)
 cachem         1.0.6   2021-08-19 [1] CRAN (R 4.1.1)
 class          7.3-19  2021-05-03 [2] CRAN (R 4.1.1)
 classInt       0.4-3   2020-04-07 [1] CRAN (R 4.0.0)
 cli            3.1.0   2021-10-27 [1] CRAN (R 4.1.1)
 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.1)
 crosstalk      1.1.1   2021-01-12 [1] CRAN (R 4.0.3)
 data.table     1.14.2  2021-09-27 [1] CRAN (R 4.1.1)
 DBI            1.1.1   2021-01-15 [1] CRAN (R 4.0.3)
 digest         0.6.28  2021-09-23 [1] CRAN (R 4.1.1)
 dplyr          1.0.7   2021-06-18 [1] CRAN (R 4.1.0)
 e1071          1.7-9   2021-09-16 [1] CRAN (R 4.1.1)
 ellipsis       0.3.2   2021-04-29 [1] CRAN (R 4.1.0)
 fansi          0.5.0   2021-05-25 [1] CRAN (R 4.1.0)
 farver         2.1.0   2021-02-28 [1] CRAN (R 4.0.4)
 fastmap        1.1.0   2021-01-25 [1] CRAN (R 4.0.4)
 generics       0.1.1   2021-10-25 [1] CRAN (R 4.1.1)
 ggplot2        3.3.5   2021-06-25 [1] CRAN (R 4.1.0)
 ggthemes       4.2.4   2021-01-20 [1] CRAN (R 4.1.0)
 glue           1.4.2   2020-08-27 [1] CRAN (R 4.0.2)
 gtable         0.3.0   2019-03-25 [1] CRAN (R 4.0.0)
 hms            1.1.1   2021-09-26 [1] CRAN (R 4.1.1)
 htmltools      0.5.2   2021-08-25 [1] CRAN (R 4.1.1)
 htmlwidgets    1.5.4   2021-09-08 [1] CRAN (R 4.1.1)
 httpuv         1.6.3   2021-09-09 [1] CRAN (R 4.1.1)
 jquerylib      0.1.4   2021-04-26 [1] CRAN (R 4.1.0)
 jsonlite       1.7.2   2020-12-09 [1] CRAN (R 4.0.3)
 KernSmooth     2.23-20 2021-05-03 [2] CRAN (R 4.1.1)
 labeling       0.4.2   2020-10-20 [1] CRAN (R 4.0.3)
 later          1.3.0   2021-08-18 [1] CRAN (R 4.1.1)
 lattice        0.20-44 2021-05-02 [2] CRAN (R 4.1.1)
 leaflet        2.0.4.1 2021-01-07 [1] CRAN (R 4.0.3)
 lifecycle      1.0.1   2021-09-24 [1] CRAN (R 4.1.1)
 lubridate      1.8.0   2021-10-07 [1] CRAN (R 4.1.1)
 magrittr       2.0.1   2020-11-17 [1] CRAN (R 4.0.3)
 memoise        2.0.0   2021-01-26 [1] CRAN (R 4.0.4)
 mime           0.12    2021-09-28 [1] CRAN (R 4.1.1)
 munsell        0.5.0   2018-06-12 [1] CRAN (R 4.0.0)
 nanotime       0.3.3   2021-08-09 [1] CRAN (R 4.1.1)
 pillar         1.6.4   2021-10-18 [1] CRAN (R 4.1.1)
 pkgconfig      2.0.3   2019-09-22 [1] CRAN (R 4.0.0)
 pool           0.1.6   2021-01-14 [1] CRAN (R 4.1.1)
 promises       1.2.0.1 2021-02-11 [1] CRAN (R 4.0.4)
 proxy          0.4-26  2021-06-07 [1] CRAN (R 4.1.0)
 purrr          0.3.4   2020-04-17 [1] CRAN (R 4.0.0)
 R6             2.5.1   2021-08-19 [1] CRAN (R 4.1.1)
 RColorBrewer   1.1-2   2014-12-07 [1] CRAN (R 4.0.0)
 Rcpp           1.0.7   2021-07-07 [1] CRAN (R 4.1.1)
 RcppCCTZ       0.2.9   2020-08-30 [1] CRAN (R 4.1.1)
 reactable      0.2.3   2020-10-04 [1] CRAN (R 4.1.1)
 reactR         0.4.4   2021-02-22 [1] CRAN (R 4.1.1)
 rlang          0.4.12  2021-10-18 [1] CRAN (R 4.1.1)
 RPostgres    * 1.4.1   2021-09-27 [1] CRAN (R 4.1.1)
 RSQLite        2.2.8   2021-08-21 [1] CRAN (R 4.1.1)
 rstudioapi     0.13    2020-11-12 [1] CRAN (R 4.0.3)
 sass           0.4.0   2021-05-12 [1] CRAN (R 4.1.0)
 scales         1.1.1   2020-05-11 [1] CRAN (R 4.0.0)
 sessioninfo    1.2.1   2021-11-02 [1] CRAN (R 4.1.1)
 sf             1.0-3   2021-10-07 [1] CRAN (R 4.1.1)
 sftzr        * 0.1.1   2021-11-12 [1] local
 shiny        * 1.7.1   2021-10-02 [1] CRAN (R 4.1.1)
 shinylogs      0.1.7   2019-08-21 [1] CRAN (R 4.1.1)
 shinythemes    1.2.0   2021-01-25 [1] CRAN (R 4.1.0)
 stringi        1.7.5   2021-10-04 [1] CRAN (R 4.1.1)
 stringr        1.4.0   2019-02-10 [1] CRAN (R 4.0.0)
 tibble         3.1.5   2021-09-30 [1] CRAN (R 4.1.1)
 tidyr          1.1.4   2021-09-27 [1] CRAN (R 4.1.1)
 tidyselect     1.1.1   2021-04-30 [1] CRAN (R 4.1.0)
 units          0.7-2   2021-06-08 [1] CRAN (R 4.1.0)
 utf8           1.2.2   2021-07-24 [1] CRAN (R 4.1.1)
 vctrs          0.3.8   2021-04-29 [1] CRAN (R 4.1.0)
 withr          2.4.2   2021-04-18 [1] CRAN (R 4.1.0)
 xtable         1.8-4   2019-04-21 [1] CRAN (R 4.0.0)
 zoo            1.8-9   2021-03-09 [1] CRAN (R 4.0.5)

 [1] C:/R-library
 [2] C:/Program Files/R/R-4.1.1/library

@pvictor
Copy link
Member

pvictor commented Nov 17, 2021

Mmh if I try something basic like below, I don't have any errors, there must be something else..

library(shiny)
library(shinylogs)
library(ggplot2)

ui <- fluidPage(
  fluidRow(
    column(
      width = 3,
      sliderInput(
        "bins", "Bins",
        min = 10, max = 50, value = 20
      )
    ),
    column(
      width = 9,
      plotOutput("plot")
    )
  )
)

server <- function(input, output, session) {
  
  track_usage(store_null(console = TRUE))
  
  output$plot <- renderPlot({
    ggplot(diamonds, aes(x = carat)) +
      geom_histogram(bins = input$bins)
  })
}

shinyApp(ui, server)

@marcusyoung
Copy link
Author

My application is obviously is a lot more complex than that, but that is all that's happening in my renderPlot() apart from the plot being returned by a function and some validate() functions beforehand.

@pvictor
Copy link
Member

pvictor commented Nov 18, 2021

Ok thanks.
I added a try catch statement on the part generating the error, it should not occur anymore, although it is not fixed.

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