quarto-dev / quarto-dev/quarto-cli

File not found when running `quarto preview --to pdf` on a large book

Open
#13,726 5 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

books bug preview
Dominant language
JavaScript
Stars
6k
Forks
458
Avg merge
1d 9h
Merged PRs (30d)
41

Description

I have:
  • searched the issue tracker for similar issues
  • installed the latest version of Quarto CLI
  • formatted my issue following the Bug Reports guide
Bug description

I am currently using Quarto books to write a thesis. Using quarto preview --to pdf the first time does indeed work, but whenever I make changes to any .qmd file the pdf gets recompiled causing the error: /web/<book-title>.pdf (404: Not Found).

My feeling is that there is a race condition somewhere since modifying my thesis (eg deleting whole chapters, reducing the overall compilation time) solve the problem.

Steps to reproduce

See https://github.com/kusnezoff-alexander/quarto-preview-to-pdf-error

Actual behavior

Output when running quarto preview --to pdf for the first time:

❯ quarto preview --to pdf
Preparing to preview
[ 1/13] index.qmd
[ 2/13] content/Background/index.qmd
<...other files..>

pandoc 
  to: latex
  from: markdown+emoji
  output-file: index.tex
  template: template.tex
  standalone: true
  toc: true
  number-sections: true
  top-level-division: chapter
  pdf-engine: lualatex
  variables:
    graphics: true
    tables: true
  default-image-extension: pdf
  
metadata
  crossref:
    chapters: true
  documentclass: scrreprt
  papersize: letter
  block-headings: true
  lst-cap-location: bottom
  fig-cap-location: bottom
  tbl-cap-location: bottom
  csl: ieee.csl
  <some_more_metadata>
  
BEWARE: your OS is not officially supported by Playwright; downloading fallback build for u
buntu20.04-x64.
BEWARE: your OS is not officially supported by Playwright; downloading fallback build for u
buntu20.04-x64.
success: successfully compiled /tmp/d2-render-b2d8687da58196d4/diagram-1.d2 to _book/diagra
m-1.pdf in 2.046727481s
BEWARE: your OS is not officially supported by Playwright; downloading fallback build for u
buntu20.04-x64.
BEWARE: your OS is not officially supported by Playwright; downloading fallback build for u
buntu20.04-x64.
success: successfully compiled /tmp/d2-render-d1ee1fc8de98a171/diagram-2.d2 to _book/diagra
m-2.pdf in 2.156744879s
WARNING (/opt/quarto-1.8.25/share/filters/main.lua:22344) FloatRefTarget with no content: f
ig-code_cim

Rendering PDF
running lualatex - 1
  This is LuaHBTeX, Version 1.17.0 (TeX Live 2023) 
   restricted system commands enabled.
  
running lualatex - 2
  This is LuaHBTeX, Version 1.17.0 (TeX Live 2023) 
   restricted system commands enabled.
  
running lualatex - 3
  This is LuaHBTeX, Version 1.17.0 (TeX Live 2023) 
   restricted system commands enabled.

Watching files for changes
Browse at http://localhost:7834/web/viewer.html
Listening on http://127.0.0.1:7834/
Opening in existing browser session.
GET: /web/viewer.html

Console output when doing any changes (causing the pdf to recompile):

[ 1/13] index.qmd
[ 2/13] content/Background/index.qmd
<...more files...>
pandoc 
  to: latex
  from: markdown+emoji
  output-file: index.tex
  template: template.tex
  standalone: true
  toc: true
  number-sections: true
  top-level-division: chapter
  pdf-engine: lualatex
  variables:
    graphics: true
    tables: true
  default-image-extension: pdf
  
metadata
  crossref:
    chapters: true
  documentclass: scrreprt
  papersize: letter
  block-headings: true
  lst-cap-location: bottom
  fig-cap-location: bottom
  tbl-cap-location: bottom
  csl: ieee.csl
  <some-more-metadata>
  
BEWARE: your OS is not officially supported by Playwright; downloading fallback build for u
buntu20.04-x64.
BEWARE: your OS is not officially supported by Playwright; downloading fallback build for u
buntu20.04-x64.
success: successfully compiled /tmp/d2-render-22d1ec558ef64c7f/diagram-1.d2 to _book/diagra
m-1.pdf in 2.017175096s
BEWARE: your OS is not officially supported by Playwright; downloading fallback build for u
buntu20.04-x64.
BEWARE: your OS is not officially supported by Playwright; downloading fallback build for u
buntu20.04-x64.
success: successfully compiled /tmp/d2-render-8e96caa0edb1dee6/diagram-2.d2 to _book/diagra
m-2.pdf in 2.030154504s
WARNING (/opt/quarto-1.8.25/share/filters/main.lua:22344) FloatRefTarget with no content: f
ig-code_cim

Rendering PDF
running lualatex - 1
  This is LuaHBTeX, Version 1.17.0 (TeX Live 2023) 
   restricted system commands enabled.
  
running lualatex - 2
  This is LuaHBTeX, Version 1.17.0 (TeX Live 2023) 
   restricted system commands enabled.
  
running lualatex - 3
  This is LuaHBTeX, Version 1.17.0 (TeX Live 2023) 
   restricted system commands enabled.
  

GET: /web/viewer.html
[ 1/13] index.qmd
[ 2/13] content/Background/index.qmd
[ 3/13] content/Title1.qmd
[ 4/13] content/Title2.qmd
  /web/<book-title>.pdf (404: Not Found)

and then it gets caught in an endless loop where it tries to recompile the pdf and saying the book pdf can't be found (_book/ is also empty)

Expected behavior

quarto preview --to pdf recompiles successfully when doing changes to my book

Your environment
  • nvim: NVIM v0.11.4
  • OS: Fedora42
Quarto check output
❯ quarto check
Quarto 1.8.25
[✓] Checking environment information...
      Quarto cache location: /home/alex/.cache/quarto
[✓] Checking versions of quarto binary dependencies...
      Pandoc version 3.6.3: OK
      Dart Sass version 1.87.0: OK
      Deno version 2.3.1: OK
      Typst version 0.13.0: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
      Version: 1.8.25
      Path: /opt/quarto-1.8.25/bin

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

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

[✓] Checking Chrome Headless....................OK
      Using: Chrome found on system
      Path: /usr/bin/chromium-browser
      Source: PATH

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

[✓] Checking Python 3 installation....OK
      Version: 3.13.9
      Path: /usr/bin/python3
      Jupyter: 5.7.2
      Kernels: .venv, myenv, python3, rust

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

[✓] Checking R installation...........OK
      Version: 4.5.1
      Path: /usr/lib64/R
      LibPaths:
        - /home/alex/R/x86_64-redhat-linux-gnu-library/4.5
        - /usr/lib64/R/library
        - /usr/share/R/library
      knitr: 1.45
      rmarkdown: 2.24

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure with quarto preview --to pdf using the linked example repository and a large book. Start by examining the preview output around PDF rendering, the /web/viewer.html request, and the empty _book/ directory. Done means edits trigger one successful PDF recompilation without a 404 or endless rebuild loop.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.