Skip to content

Website sidebar section glob matching no inputs crashes pre-render in findIndexFile #14757

Description

@jph00

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

A website project crashes at pre-render when a sidebar section's contents is a glob that matches no project inputs and the glob's basename starts with * (for example docs/*.ipynb in a project with no notebooks).

The boundary is narrow. The same glob with at least one match renders fine. An unmatched glob whose basename has a prefix before the star, such as docs/nomatch-*.ipynb, also renders fine. The extension makes no difference. A section whose contents is a bare directory crashes identically when that directory contains no index file.

This is a regression: the same configuration built cleanly for a long time before 1.10 (it comes from the sidebar of https://github.com/AnswerDotAI/fasthtml, which renders a staged subset of inputs during README generation, so its globs can legitimately match nothing).

Steps to reproduce

Three files:

_quarto.yml:

project:
  type: website

website:
  sidebar:
    contents:
      - index.qmd
      - section: Docs
        contents: docs/*.ipynb

index.qmd and docs/a.qmd: any trivial page.

Then run quarto render. Note there is no .ipynb file anywhere, so the section glob matches nothing.

Actual behavior

ERROR: TypeError: Cannot convert undefined or null to object

Stack trace:
    at Object.keys (<anonymous>)
    at findIndexFile (file:///Applications/quarto/bin/quarto.js:146701:17)
    at nodesToEntries (file:///Applications/quarto/bin/quarto.js:146655:21)
    at sidebarItemsFromAuto (file:///Applications/quarto/bin/quarto.js:146583:16)
    at expandAutoSidebarItems (file:///Applications/quarto/bin/quarto.js:146510:31)
    at expandAutoSidebarItems (file:///Applications/quarto/bin/quarto.js:146533:31)
    at resolveSidebarItems (file:///Applications/quarto/bin/quarto.js:147918:30)
    at sidebarEjsData (file:///Applications/quarto/bin/quarto.js:147909:9)
    at async sidebarsEjsData (file:///Applications/quarto/bin/quarto.js:147894:22)
    at async initWebsiteNavigation (file:///Applications/quarto/bin/quarto.js:147263:27)
    at async Object.preRender (file:///Applications/quarto/bin/quarto.js:152689:5)

Expected behavior

The section renders empty, or a warning names the glob that matched nothing. Both match the behavior of earlier Quarto versions.

Your environment

macOS (Apple Silicon), Quarto 1.10.18 from the installer at /Applications/quarto.

Quarto check output

Quarto 1.10.18
[>] Checking environment information...
      Quarto cache location: /Users/jhoward/Library/Caches/quarto
[>] Checking versions of quarto binary dependencies...
      Pandoc version 3.10.0: OK
      Dart Sass version 1.101.0: OK
      Deno version 2.7.14: OK
      Typst version 0.15.1: OK
[>] Checking versions of quarto dependencies......OK
[>] Checking Quarto installation......OK
      Version: 1.10.18
      Path: /Applications/quarto/bin
[>] Checking basic markdown render....OK
[>] Checking Python 3 installation....OK
      Version: 3.13.2
      Jupyter: 5.9.1
[>] Checking Jupyter engine render....OK

This report was researched and written by Fable (Anthropic's Claude), with jph00's supervision.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions