daattali/shinyjs

renderUI: attempt to apply non-function error with shinyjs2.0

iqbals opened this issue · 2 comments

I have an error:

Warning: Error in renderUI: attempt to apply non-function
  96: renderUI [/Users/sumaiya/Broad_Work/v2p/App/miscast07302020_replica/miscast07302020_r2/server.R#8281]
  95: func
  82: origRenderFunc
  81: output$msaResearchVSR
   1: shiny::runApp

thrown from following lines in the server.R (line # 8281 is the call to function: shinyjs::js$runMsa, see below)

output$msaResearchVSR <- renderUI({
    gene_wise_info=read_delim(paste("gene_wise_info/",input$reportTgeneSelected,".txt",sep=''), "\t", escape_double = FALSE, trim_ws = TRUE)
    shinyjs::js$runMsa(containerId=msaContainerVSRId, aaInputId="aa_Selected", sequence=paste(gene_wise_info$`Amino Acid`, collapse=""))
  })

The code and my app runs perfectly with shinyjs 1.0, but when I installed shinyjs 2.0, I get this error.
Any help will be very much appreciated

Did you notice the breaking change from version 1 to 2, that extendShinyjs() now requires the use of the functions argument? It's possible that you didn't specify runMsa in that argument

I see.
Yes, adding the following line solved it - thank you!

shinyjs::extendShinyjs(text = jscode, functions = c("runMsa"))