为什么Shiny的默认应用会导致JavaScript错误和警告?

时间:2019-02-01 10:48:22

标签: javascript r shiny

在Firefox中运行RStudion(旧忠实间歇泉数据)的默认闪亮应用程序时,控制台中显示了一些JavaScript错误和警告,而该应用程序本身运行良好。为什么会发生?

在线访问Shiny-apps时也会发生相同的错误,例如https://shiny.rstudio.com/gallery/lego-set.html

背景:我的应用程序运行缓慢,但我想确保安装程序一切正常。由于我检查过的所有应用程序(在应用程序本身运行良好的情况下)的控制台中都显示了JavaScript错误和警告,因此我想确保这些操作不会造成性能问题。

这是Firefox控制台的输出:

undefined pageModifier.js:585:9
Mutations-Ereignisse sollten nicht mehr verwendet werden. Verwenden Sie MutationObserver stattdessen. pageModifier.js:81:20
[Exception... "Favicon at "http://127.0.0.1:4399/favicon.ico" failed to load: Not Found."  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: resource:///modules/FaviconLoader.jsm :: onStopRequest :: line 186"  data: no]
unreachable code after return statement ExtensionContent.jsm:513:8
Unchecked lastError value: Error: Script '<anonymous code>' result is non-structured-clonable data background.js:273
unreachable code after return statement ExtensionContent.jsm:517:8
Unchecked lastError value: Error: Script '<anonymous code>' result is non-structured-clonable data background.js:273
unreachable code after return statement ExtensionContent.jsm:515:8
Unchecked lastError value: Error: Script '<anonymous code>' result is non-structured-clonable data background.js:273
unreachable code after return statement ExtensionContent.jsm:513:8
Unchecked lastError value: Error: Script '<anonymous code>' result is non-structured-clonable data background.js:273
unreachable code after return statement ExtensionContent.jsm:517:8
Unchecked lastError value: Error: Script '<anonymous code>' result is non-structured-clonable data background.js:273
unreachable code after return statement ExtensionContent.jsm:515:8
Unchecked lastError value: Error: Script '<anonymous code>' result is non-structured-clonable data background.js:273

我使用Firefox 65在Windows 7,R 3.3.3版(2017年3月6日),有光泽和1.2.0版本RStudio 1.0.136。

这是应用程序(不变的新闪亮应用程序):

#
# This is a Shiny web application. You can run the application by clicking
# the 'Run App' button above.
#
# Find out more about building applications with Shiny here:
#
#    http://shiny.rstudio.com/
#

library(shiny)

# Define UI for application that draws a histogram
ui <- fluidPage(

   # Application title
   titlePanel("Old Faithful Geyser Data"),

   # Sidebar with a slider input for number of bins 
   sidebarLayout(
      sidebarPanel(
         sliderInput("bins",
                     "Number of bins:",
                     min = 1,
                     max = 50,
                     value = 30)
      ),

      # Show a plot of the generated distribution
      mainPanel(
         plotOutput("distPlot")
      )
   )
)

# Define server logic required to draw a histogram
server <- function(input, output) {

   output$distPlot <- renderPlot({
      # generate bins based on input$bins from ui.R
      x    <- faithful[, 2] 
      bins <- seq(min(x), max(x), length.out = input$bins + 1)

      # draw the histogram with the specified number of bins
      hist(x, breaks = bins, col = 'darkgray', border = 'white')
   })
}

# Run the application 
shinyApp(ui = ui, server = server)

1 个答案:

答案 0 :(得分:0)

由于Firefox插件"Citavi Picker, Version 2017.12.21",发生了错误。禁用此插件,错误消失了。

让我们看看their support在说什么...