quarto-dev / quarto-cli

Open-source scientific and technical publishing system built on Pandoc.
https://quarto.org
Other
3.81k stars 309 forks source link

Quarto preview fails with a listing driven by a very large .yml file #6839

Closed jimjam-slam closed 10 months ago

jimjam-slam commented 1 year ago

Bug description

In https://github.com/360-info/training-datajournalism (rendered site here), I've prepared a Quarto example website with a page, lessons/scraping-cards/index.qmd. That file (ab)uses Quarto's custom listing feature to:

(a) Tidy up and join some data frames in R and output it as a YAML array (all on render in a series of R chunks) in suburbs.yml (b) Render a listing driven by suburbs.yml

The idea here is to simulate the kinds of data dashboards you often see in the public space (the exercise is to scrape this back into a spreadsheet with Google Sheets).

However, at the moment I've added a filter to restrict the data to the 100 most populous suburbs (down from about 2500 suburbs).

The full dataset works with other web servers (eg. if I quarto render; cd _site; python3 -m http.server), but quarto preview hangs on the page when I try to load it, saying that it's reading suburbs.yml.

(I'm not saying that this is a smart use of Quarto listings at this scale—any real production system would likely have server-side pagination, and the HTML output with the full dataset is several megabytes—but since I hit a problem that seems to be unique to quarto preview, I wanted to document it!)

Steps to reproduce

  1. Clone https://github.com/360-info/training-datajournalism
  2. quarto render and quarto preview; navigate to lessons/scraping-cards; verify it works
  3. Remove the slice_max filter from the R chunk before it writes out to suburbs.yml
  4. quarto render and quarto preview; navigate to lessons/scraping-cards; verify it no longer works and that it reports trying to load suburbs.yml
  5. cd _site; python3 -m http.server (or another preview server); navigate to lessons/scraping-cards; verify it works with this server

Expected behavior

Expect the previewed page to load.

Actual behavior

Blank page, with a render message up the top of the browser saying that it's trying to load suburbs.yml.

Your environment

Quarto check output

quarto check
[✓] Checking versions of quarto binary dependencies...
      Pandoc version 3.1.2: OK
      Dart Sass version 1.55.0: OK
      Deno version 1.33.2: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
      Version: 99.9.9
      Path: /Users/jgol0005/code/quarto-cli/package/dist/bin

[✓] Checking basic markdown render....OK

[✓] Checking Python 3 installation....OK
      Version: 3.9.7 (Conda)
      Path: /Users/jgol0005/miniforge3/bin/python
      Jupyter: 4.9.2
      Kernels: python3

[✓] Checking Jupyter engine render....OK

[✓] Checking R installation...........OK
      Version: 4.3.1
      Path: /Library/Frameworks/R.framework/Resources
      LibPaths:
        - /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library
      knitr: 1.43
      rmarkdown: 2.23

[✓] Checking Knitr engine render......OK
rgaiacs commented 1 year ago

Thanks for the issue. I can't reproduce it. quarto preview --no-browser --port 8864 produces

Preparing to preview
[1/2] index.qmd
[2/2] lessons/scraping-cards/index.qmd

processing file: index.qmd
  |.............                                  |  29% (download-census-data)System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down
trying URL 'https://www.abs.gov.au/census/find-census-data/datapacks/download/2021_GCP_SAL_for_VIC_short-header.zip'
Content type 'application/zip' length 23480366 bytes (22.4 MB)
==================================================
downloaded 22.4 MB

output file: index.knit.md

Watching files for changes
Browse at http://localhost:8864/
GET: /
  /styles.css (404: Not Found)
  /styles.css (404: Not Found)
GET: /lessons/scraping-cards/
  /lessons/scraping-cards/styles.css (404: Not Found)
  /lessons/scraping-cards/styles.css (404: Not Found)

I'm running Ubuntu 22.04 LTS. quarto check output is

[✓] Checking versions of quarto binary dependencies...
      Pandoc version 3.1.2: OK
      Dart Sass version 1.55.0: OK
      Deno version 1.33.4: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
      Version: 1.4.330
      Path: /opt/quarto/bin

[✓] Checking tools....................OK
      TinyTeX: (not installed)
      Chromium: (not installed)

[✓] Checking LaTeX....................OK
      Using: Installation From Path
      Path: /usr/bin
      Version: 2021

[✓] Checking basic markdown render....OK

[✓] Checking Python 3 installation....OK
      Version: 3.10.6
      Path: /usr/bin/python3
      Jupyter: 5.2.0
      Kernels: python3

[✓] Checking Jupyter engine render....OK

[✓] Checking R installation...........OK
      Version: 4.2.2
      Path: /usr/lib/R
      LibPaths:
        - /home/raniere/R/x86_64-pc-linux-gnu-library/4.2
        - /usr/local/lib/R/site-library
        - /usr/lib/R/site-library
        - /usr/lib/R/library
      knitr: 1.42
      rmarkdown: 2.20

[✓] Checking Knitr engine render......OK
dragonstyle commented 10 months ago

I wasn't able to reproduce this either using the latest pre-release build (it took a bit given the size of the document, but ultimately previewed just fine). I'll close this for now, please feel free to re-open / reply if this is something we should look into further.