Skip to content

File in subdirectory not found #11360

Open

Description

Bug description

I recently updated to quarto version 1.5.57 from 1.5.35. After updating, quarto inspect is no longer able to find a document file in a subdirectory. Ironically, quarto render works fine. I could bisect that this problem appeard between v1.5.51 and v1.5.57. I assume this commit is the culprit.

Please see this MR as a reference where the issue appeared first.

Steps to reproduce

Create these files:

Main file:

---
title: main
format:
  html:
    default
---

{{< include "subdir/text2.qmd" >}}

Text 2 (in ./subdir/):

# Second File

Some text here.

{{< include "subdir/b/text3.qmd" >}}

Text 3 (in ./subdir/b/):

# Third File

Some text here.

Now, run quarto inspect.

Expected behavior

quarto inspect outputs the desired information.

Actual behavior

quarto inspect fails with the following message:

ERROR: NotFound: No such file or directory (os error 2): readfile '/home/***/tmp/tarche-test/subdir/subdir/b/text3.qmd'
Path: /home/***/tmp/tarche-test/subdir/subdir/b/text3.qmd

Stack trace:
Path: /home/***/tmp/tarche-test/subdir/subdir/b/text3.qmd
    at readTextFileSync (ext:deno_fs/30_fs.js:859:10)
    at Object.Deno.readTextFileSync (file:///tmp/.mount_quartodxyAMD/usr/bin/quarto.js:5047:25)
    at mappedStringFromFile (file:///tmp/.mount_quartodxyAMD/usr/bin/quarto.js:19592:24)
    at Object.markdownForFile (file:///tmp/.mount_quartodxyAMD/usr/bin/quarto.js:40863:32)
    at mdForFile (file:///tmp/.mount_quartodxyAMD/usr/bin/quarto.js:40283:29)
    at inner (file:///tmp/.mount_quartodxyAMD/usr/bin/quarto.js:40322:67)
    at inner (file:///tmp/.mount_quartodxyAMD/usr/bin/quarto.js:40322:23)
    at async projectResolveCodeCellsForFile (file:///tmp/.mount_quartodxyAMD/usr/bin/quarto.js:40342:5)
    at async inspectConfig (file:///tmp/.mount_quartodxyAMD/usr/bin/quarto.js:101478:13)
    at async Command.actionHandler (file:///tmp/.mount_quartodxyAMD/usr/bin/quarto.js:101515:20)

quarto render runs fine. Even after removing the subdir in the include of text3.qmd, the command fails.

Your environment

  • OS: Linux

Quarto check output

Quarto 1.5.57
[✓] Checking versions of quarto binary dependencies...
      Pandoc version 3.2.0: OK
      Dart Sass version 1.70.0: OK
      Deno version 1.41.0: OK
      Typst version 0.11.0: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
      Version: 1.5.57
      Path: /tmp/.mount_quartoWCrNeu/usr/bin

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

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

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

[✓] Checking Python 3 installation....OK
      Version: 3.12.7
      Path: /usr/bin/python3
      Jupyter: (None)

      Jupyter is not available in this Python installation.
      Install with python3 -m pip install jupyter

[✓] Checking R installation...........OK
      Version: 4.4.1
      Path: /usr/lib64/R
      LibPaths:
        - /home/***/.local/share/R/R.library
        - /usr/lib64/R/library
        - /usr/share/R/library
      knitr: 1.48
      rmarkdown: 2.26

[✓] Checking Knitr engine render......OK
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions