'Library eror deploying shiny app on shinyapps.io

I've finished a shiny app with leaflet on R but I can't deploy it. It works well on my computer and my virtual machine but not on https://www.shinyapps.io. Actually it's just an interactive map

The error message is :

shinyapps[XXXXXXXX]: Warning: Error in leafletOutput: could not find function "leafletOutput"

And my full code is :

server <- function(input, output, session) {
  output$nameuser <- renderText({
    paste0("Votre carte est complète ", input$name, " !")
      })
  library(readxl)
  library(shiny)
  library(maps)
  library(leaflet) 
  library(mapproj)
  library(dplyr)
  library(tidyverse)
  library(shinyWidgets)
  
  [...]
  

  output$maptoplot <- renderLeaflet({
   [...]
    input$form_start
    title <- tags$div(
      tag.map.title, HTML(input$name)) 
    validate(
      need(univ_data != "", "Aucun résultat pour les critères sélectionnés.")
    )
    url <- "https://api.mapbox.com/styles/v1/jjabouille/cl27v51bu00l214mqgnrswkmf/tiles/256/{z}/{x}/{y}@2x?access_token=pk.eyJ1IjoiamphYm91aWxsZSIsImEiOiJjbDI3djNzcnQwM2IzM2NxcnJheWZkdnpnIn0.J5FxtNNYAhhykIhqTTyUOA"
    leaflet(quakes) %>%
    addTiles(
    urlTemplate = url,
    attribution = "App made by Jules Jabouille") %>%
    addControl(title, position = "topleft", className="map-title") %>% 
    addMarkers(
    lng = univ_data$lng,
    lat = univ_data$lat,
    icon = icone_IELTS,
    # En passant la souris
    label = univ_data$`University Name`, 
    # En cliquant sur l'icone
    popup = ~paste0("<h4>", univ_data$`University Name`),
                                        
    )
    })

  }

And the User part is here :

ui <- fluidPage(
  titlePanel("my title"),

  # Sidebar layout with input and output definitions ----
  sidebarLayout(
    
    [...]

    ),
    # Main panel for displaying outputs ----
    mainPanel(leafletOutput("maptoplot", height = 800)
              )
      

  )
)

Thanks a lot for your feedback !

Jules



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source