After upgrading to R 3.6.0 and maybe some package, the app using promises showing error: Warning: Error in eval: object 'rows' not found
Below is the code of app. See it online in shinyapps.io also.
library(shiny)
library(glue)
library(promises)
library(future)
plan(multiprocess)
ui <- fluidPage(
# Application title
titlePanel("test promises in shiny"),
sidebarLayout(
sidebarPanel(
sliderInput("rows",
"Number of rows:",
min = 1,
max = 50,
value = 30)
),
mainPanel(
textOutput("session"),
tableOutput('table')
)
)
)
server <- function(input, output) {
df <- reactive({
rows <- input$rows
future({
con <- DBI::dbConnect(RSQLite::SQLite(), ":memory:")
DBI::dbWriteTable(con, "mtcars", mtcars)
query <- glue_sql("select * from mtcars limit {rows}", .con = con)
dbGetQuery(con, query)
})
})
output$table <- renderTable({
df()
})
output$session <- renderPrint({
sessionInfo()
})
}
# Run the application
shinyApp(ui = ui, server = server)
EDIT: I open an issue in future github rep too. See here