quarto-dev / quarto-dev/quarto-cli
Website sidebar section glob matching no inputs crashes pre-render in findIndexFile
Nobody has claimed this yet.
- 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
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the failure with the three-file project described in _quarto.yml, index.qmd, and docs/a.qmd, then run quarto render. Start by tracing findIndexFile from the reported stack trace and inspect how an unmatched sidebar glob is handled; done means the project renders an empty section or emits a warning instead of crashing.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- cli, web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100