Skip to content

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

@kusnezoff-alexander

Description

@kusnezoff-alexander

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    booksbugSomething isn't workingpreviewissues related to the `preview` command

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions