title: Shiny.setInputValue is not a function error
body: <p>I am baffled why the following code produces the &quot;Shiny.setInputValue is not a function&quot; error:</p>
  <pre><code>library(shiny)
  library(htmltools)
  
  # Define UI for application that draws a histogram
  ui &lt;- fluidPage(
      
      
      # Application title
      titlePanel(&quot;Test&quot;),
  
      # Sidebar with a slider input for number of bins 
      sidebarLayout(
          sidebarPanel(
              
          ),
  
          # Show a plot of the generated distribution
          mainPanel(
            shiny::tags$script(htmltools::HTML('
    quantityaa = 1;
    console.log(quantityaa);
    Shiny.setInputValue(&quot;hi&quot;, quantityaa);
                                    '))
         ,
         
          )
          )
          
  )
  
  # Define server logic required to draw a histogram
  server &lt;- function(input, output) {
      
      hi &lt;- reactive({ input$hi})
      print(hi)
      
  }
  
  # Run the application 
  shinyApp(ui = ui, server = server)
  </code></pre>
  <p>What is wrong with this code that produces this error? I cannot see anything wrong with it, but I must be missing something.</p>