I just finished creating a Shiny dashboard that uses querychat to filter a data set in R and load a bunch of figures, as well as a table. The dash loads fine locally and I was able to publish without error BUT when I actually go to the link for the dashboard, it starts to load and then seems to time out without any of the figures or the table populating; for example, I can't even test the chat function because the dashboard times out--i.e., the screen goes light grey and I get the "Disconnected from Server. Reload" message in the bottom left of my screen.
I have plenty of LLM credits to run querychat (as I noted, the dashboard works fine locally), but I am using the free version of Shiny. My questions are:
Has anyone run into this and found a way to publish a querychat dashboard?
Is this a data issue (my data frame has 1,092 rows and 21 columns) that would require upgrading my Shiny subscription?
Is it possible you’re using an absolute path to load your data? Or if you’re developing on Windows locally, perhaps the path you’re using has different case than the correct path (because Windows paths are case insensitive but Linux paths are case sensitive)?
Here's what the log looks like--nothing jumps out, but I'm not a Shiny expert.
2025-05-06T19:49:14.782291+00:00 shinyapps[14699110]: Use the conflicted package (http://conflicted.r-lib.org/) to force all conflicts to become errors
2025-05-06T19:49:14.786649+00:00 shinyapps[14699110]:
2025-05-06T19:49:14.791154+00:00 shinyapps[14699110]: Attaching package: ‘DT’
2025-05-06T19:49:14.795684+00:00 shinyapps[14699110]:
2025-05-06T19:49:14.799897+00:00 shinyapps[14699110]: The following objects are masked from ‘package:shiny’:
2025-05-06T19:49:14.804715+00:00 shinyapps[14699110]:
2025-05-06T19:49:14.809428+00:00 shinyapps[14699110]: dataTableOutput, renderDataTable
2025-05-06T19:49:14.813955+00:00 shinyapps[14699110]:
2025-05-06T19:49:15.729605+00:00 shinyapps[14699110]: Linking to GEOS 3.10.2, GDAL 3.4.1, PROJ 8.2.1; sf_use_s2() is TRUE
2025-05-06T19:49:15.734521+00:00 shinyapps[14699110]: To enable caching of data, set options(tigris_use_cache = TRUE)
2025-05-06T19:49:15.738855+00:00 shinyapps[14699110]: in your R script or .Rprofile.
2025-05-06T19:49:15.743248+00:00 shinyapps[14699110]:
2025-05-06T19:49:15.747417+00:00 shinyapps[14699110]: Attaching package: ‘plotly’
2025-05-06T19:49:15.751882+00:00 shinyapps[14699110]:
2025-05-06T19:49:15.756227+00:00 shinyapps[14699110]: The following object is masked from ‘package:ggplot2’:
2025-05-06T19:49:15.760493+00:00 shinyapps[14699110]:
2025-05-06T19:49:15.765056+00:00 shinyapps[14699110]: last_plot
2025-05-06T19:49:15.769481+00:00 shinyapps[14699110]:
2025-05-06T19:49:15.774227+00:00 shinyapps[14699110]: The following object is masked from ‘package:stats’:
2025-05-06T19:49:15.778257+00:00 shinyapps[14699110]:
2025-05-06T19:49:15.782479+00:00 shinyapps[14699110]: filter
2025-05-06T19:49:15.786659+00:00 shinyapps[14699110]:
2025-05-06T19:49:15.791404+00:00 shinyapps[14699110]: The following object is masked from ‘package:graphics’:
2025-05-06T19:49:15.795903+00:00 shinyapps[14699110]:
2025-05-06T19:49:15.800122+00:00 shinyapps[14699110]: layout
2025-05-06T19:49:15.804715+00:00 shinyapps[14699110]:
2025-05-06T19:49:15.809335+00:00 shinyapps[14699110]:
2025-05-06T19:49:15.813756+00:00 shinyapps[14699110]: Attaching package: ‘janitor’
2025-05-06T19:49:15.817992+00:00 shinyapps[14699110]:
2025-05-06T19:49:15.823172+00:00 shinyapps[14699110]: The following objects are masked from ‘package:stats’:
2025-05-06T19:49:15.827332+00:00 shinyapps[14699110]:
2025-05-06T19:49:15.831820+00:00 shinyapps[14699110]: chisq.test, fisher.test
2025-05-06T19:49:15.836363+00:00 shinyapps[14699110]:
2025-05-06T19:49:17.762836+00:00 shinyapps[14699110]: Rows: 1092 Columns: 21
2025-05-06T19:49:17.767582+00:00 shinyapps[14699110]: ── Column specification ────────────────────────────────────────────────────────
2025-05-06T19:49:17.772308+00:00 shinyapps[14699110]: Delimiter: ","
2025-05-06T19:49:17.777007+00:00 shinyapps[14699110]: chr (17): project_title, org_name, org_city, org_state, org_district, usasp...
2025-05-06T19:49:17.781782+00:00 shinyapps[14699110]: dbl (1): Grant Number
2025-05-06T19:49:17.786316+00:00 shinyapps[14699110]: date (3): termination_letter_date, nsf_startdate, nsf_expected_end_date
2025-05-06T19:49:17.791034+00:00 shinyapps[14699110]:
2025-05-06T19:49:17.795730+00:00 shinyapps[14699110]: Use spec() to retrieve the full column specification for this data.
2025-05-06T19:49:17.800092+00:00 shinyapps[14699110]: Specify the column types or set show_col_types = FALSE to quiet this message.
2025-05-06T19:49:18.730313+00:00 shinyapps[14699110]:
2025-05-06T19:49:18.734912+00:00 shinyapps[14699110]: Listening on http://127.0.0.1:45361
2025-05-06T19:49:19.838243+00:00 shinyapps[14699110]: Retrieving data for the year 2024
2025-05-06T19:49:20.740637+00:00 shinyapps[14699110]: Warning: Returning more (or less) than 1 row per summarise() group was deprecated in
2025-05-06T19:49:20.745318+00:00 shinyapps[14699110]: dplyr 1.1.0.
2025-05-06T19:49:20.749763+00:00 shinyapps[14699110]: Please use reframe() instead.
2025-05-06T19:49:20.754243+00:00 shinyapps[14699110]: When switching from summarise() to reframe(), remember that reframe()
2025-05-06T19:49:20.758428+00:00 shinyapps[14699110]: always returns an ungrouped data frame and adjust accordingly.
In the free version of Shiny server, you cannot reference hidden variables--like API keys--through the platform, you have to have them in the folder. This creates a ton of annoying downstream issues (well, maybe not a ton but if you're using Git, you have to be a little more careful). Posit Connect Cloud allows you to just enter the api keys, which made things work easily.
I found that the syntax around the menu for querychat can throw data table errors if you aren't careful. So even in Connect Cloud, a user told me that they weren't able to actually chat with the data without an error.
I feel like the load times are slow. Maybe this is an LLM api thing, maybe it's the code, it could be because I'm using both leaflet and plotly (it's probably this), but if anyone has tips on checking this sort of thing, I'd welcome them.
As far as number 2, I made a typo in the greeting that stopped the data table step in the UI from loading properly, but notably the overall dashboard still loaded, so the error wasn't immediately obvious. I don't think this is necessarily a querychat issue, but it was part of the trouble shooting experience that I'd thought I'd share.