rstudio / shinyuieditor

A GUI for laying out a Shiny application that generates clean and human-readable UI code
https://rstudio.github.io/shinyuieditor/
MIT License
209 stars 29 forks source link

Something went wrong parsing app. Check to make sure your app text doesn't contain any syntax errors #165

Closed jooyoungseo closed 8 months ago

jooyoungseo commented 1 year ago

I see the following error after running Start ShinyUiEditor on current file

image

My code does not contain any syntax errors:

library(shiny)

# Front-end interface
ui <- fluidPage(
  sidebarLayout(
    sidebarPanel = titlePanel(title = "Histogram Playground with Shiny"),
    mainPanel = sidebarPanel(
      "Side panel:",
      numericInput(
        inputId = "num",
        label = "Type number:",
        value = 100
      ),
      selectInput(
        inputId = "col",
        label = "Choose color:",
        choices = colors(),
        selected = "green"
      )
    )
  ),
  mainPanel(
    "Main panel:",
    plotOutput(outputId = "hist")
  )
)

# Back-end interface
server <- function(input, output) {
  num <- reactive({
    input$num
  })

  col <- reactive({
    input$col
  })

  output$hist <- renderPlot(
    hist(rnorm(num()), col = col())
  )
}

# Launch Shiny
shinyApp(ui, server)
jooyoungseo commented 1 year ago

R System Info

xfun::session_info("shinyuieditor")
#> R version 4.3.0 (2023-04-21 ucrt)
#> Platform: x86_64-w64-mingw32/x64 (64-bit)
#> Running under: Windows 11 x64 (build 22621)
#> 
#> 
#> Locale:
#>   LC_COLLATE=English_United States.utf8 
#>   LC_CTYPE=English_United States.utf8   
#>   LC_MONETARY=English_United States.utf8
#>   LC_NUMERIC=C                          
#>   LC_TIME=English_United States.utf8    
#> 
#> time zone: America/Chicago
#> tzcode source: internal
#> 
#> Package version:
#>   askpass_1.1         base64enc_0.1.3     bsicons_0.1        
#>   bslib_0.4.2.9000    cachem_1.0.7        callr_3.7.3        
#>   cli_3.6.1           colorspace_2.1.0    commonmark_1.9.0   
#>   cpp11_0.4.3         crayon_1.5.2        crosstalk_1.2.0    
#>   curl_5.0.0          data.table_1.14.8   digest_0.6.31      
#>   dplyr_1.1.2         DT_0.27             ellipsis_0.3.2     
#>   evaluate_0.20       fansi_1.0.4         farver_2.1.1       
#>   fastmap_1.1.1       fontawesome_0.5.1   fs_1.6.1           
#>   generics_0.1.3      ggplot2_3.4.2       glue_1.6.2         
#>   graphics_4.3.0      grDevices_4.3.0     grid_4.3.0         
#>   gridlayout_0.2.0    gtable_0.3.3        highr_0.10         
#>   htmltools_0.5.5     htmlwidgets_1.6.2   httpuv_1.6.9       
#>   httr_1.4.5          isoband_0.2.7       jquerylib_0.1.4    
#>   jsonlite_1.8.4      knitr_1.42          labeling_0.4.2     
#>   later_1.3.0         lattice_0.21.8      lazyeval_0.2.2     
#>   lifecycle_1.0.3     magrittr_2.0.3      MASS_7.3.59        
#>   Matrix_1.5.4        memoise_2.0.1       methods_4.3.0      
#>   mgcv_1.8.42         mime_0.12           munsell_0.5.0      
#>   nlme_3.1.162        openssl_2.0.6       pillar_1.9.0       
#>   pkgconfig_2.0.3     plotly_4.10.1       processx_3.8.1     
#>   promises_1.2.0.1    ps_1.7.5            purrr_1.0.1        
#>   R6_2.5.1            rappdirs_0.3.3      RColorBrewer_1.1.3 
#>   Rcpp_1.0.10         rlang_1.1.0         rmarkdown_2.21     
#>   sass_0.4.5          scales_1.2.1        shiny_1.7.4        
#>   shinyuieditor_0.4.3 sourcetools_0.1.7.1 splines_4.3.0      
#>   stats_4.3.0         stringi_1.7.12      stringr_1.5.0      
#>   sys_3.4.1           tibble_3.2.1        tidyr_1.3.0        
#>   tidyselect_1.2.0    tinytex_0.45        tools_4.3.0        
#>   utf8_1.2.3          utils_4.3.0         vctrs_0.6.2        
#>   viridisLite_0.4.1   withr_2.5.0         xfun_0.39          
#>   xtable_1.8.4        yaml_2.3.7

Created on 2023-04-23 with reprex v2.0.2

VSCode Info

Version: 1.78.0-insider (system setup) Commit: b19017cea80b6157aa8214c984a70022e77526f2 Date: 2023-04-21T05:21:50.420Z Electron: 22.4.7 Chromium: 108.0.5359.215 Node.js: 16.17.1 V8: 10.8.168.25-electron.0 OS: Windows_NT x64 10.0.22621 Sandboxed: Yes

Fred-Wu commented 1 year ago

I encountered the same error for the demo app as simple as below from the Gallery

n <- 200

# Define the UI
ui <- bootstrapPage(
  numericInput(
    "n",
    "Number of obs",
    n
  ),
  plotOutput("plot")
)

# Define the server code
server <- function(input, output) {
    output$plot <- renderPlot({
        hist(runif(input$n))
    })
}

# Return a Shiny app object
shinyApp(ui = ui, server = server)
Gundura commented 10 months ago

Hey, I had the same error message. All I had to do, was to change the line endings from CRLF to LF and it worked! So it actually was a syntax error...

nstrayer commented 8 months ago

Closing this as it seems like it may be resolved. Please feel free to reopen if the problem remains!