【发布时间】:2019-02-01 10:48:22
【问题描述】:
在 Firefox 中运行 RStudion(Old Faithful Geyser Data)的默认闪亮应用程序时,控制台中显示了几个 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
我在 Windows 7、R 版本 3.3.3 (2017-03-06)、闪亮的 1.2.0 和 RStudio 版本 1.0.136 上使用 Firefox 65。
这是应用程序(未更改的新闪亮应用程序):
#
# 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)
【问题讨论】:
-
无法使用 R-3.5.1、shiny-1.2.0、win10_64、FF-65.0 进行复制。 weakly-related posts 建议在禁用附加组件的情况下重新启动 FF 并查看行为是否继续。如果它停止,那么您的附加组件之一正在干扰。话虽如此,包括您启用的 FF 附加组件列表可能会提供信息。
标签: javascript r shiny