quarto-dev / quarto-dev/quarto-cli

`quarto preview` fails with `.gitstatus` file error when triggered from VSCode UI

Open
#13,572 1 comment 1 reaction 2 assignees View on GitHub

@cderv is already working on this.

Since Oct 17, 2025.

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

Description

Description

quarto preview fails with a "No such file or directory" error when launched from VSCode's preview button, but works correctly from the command line.

Error Details

ERROR: NotFound: No such file or directory (os error 2): stat '/Users/mcanouil/Projects/perso/mickael.canouil.fr/.git/.gitstatus.q5RmYq'
Full trace
ERROR: NotFound: No such file or directory (os error 2): stat '/Users/mcanouil/Projects/perso/mickael.canouil.fr/.git/.gitstatus.q5RmYq'

Stack trace:
    at Object.statSync (ext:deno_fs/30_fs.js:415:3)
    at createWalkEntrySync (https://jsr.io/@std/fs/1.0.16/_create_walk_entry.ts:22:21)
    at walkSync (https://jsr.io/@std/fs/1.0.16/walk

https://github.com/user-attachments/assets/c5e3307f-7593-4778-abfe-da0871cb4d7f

.ts:904:11)
    at walkSync.next (<anonymous>)
    at advanceMatch (https://jsr.io/@std/fs/1.0.16/expand_glob.ts:497:13)
    at advanceMatch.next (<anonymous>)
    at expandGlobSync (https://jsr.io/@std/fs/1.0.16/expand_glob.ts:518:18)
    at expandGlobSync.next (<anonymous>)
    at expandGlobs (file:///Users/mcanouil/Projects/quarto-dev/quarto-cli/src/core/path.ts:170:15)
    at resolveGlobs (file:///Users/mcanouil/Projects/quarto-dev/quarto-cli/src/core/path.ts:288:24)
    at resolvePathGlobs (file:///Users/mcanouil/Projects/quarto-dev/quarto-cli/src/core/path.ts:180:10)
    at projectResourceFiles (file:///Users/mcanouil/Projects/quarto-dev/quarto-cli/src/project/project-resources.ts:45:34)
    at projectContext (file:///Users/mcanouil/Projects/quarto-dev/quarto-cli/src/project/project-context.ts:397:22)
    at eventLoopTick (ext:core/01_core.js:179:7)
    at async Command.actionHandler (file:///Users/mcanouil/Projects/quarto-dev/quarto-cli/src/command/preview/cmd.ts:280:23)
    at async Command.execute (https://deno.land/x/cliffy@v1.0.0-rc.3/command/command.ts:1948:7)
    at async Command.parseCommand (https://deno.land/x/cliffy@v1.0.0-rc.3/command/command.ts:1780:14)
    at async quarto (file:///Users/mcanouil/Projects/quarto-dev/quarto-cli/src/quarto.ts:193:5)
    at async file:///Users/mcanouil/Projects/quarto-dev/quarto-cli/src/quarto.ts:225:5
    at async file:///Users/mcanouil/Projects/quarto-dev/quarto-cli/src/core/main.ts:45:14
    at async mainRunner (file:///Users/mcanouil/Projects/quarto-dev/quarto-cli/src/core/main.ts:47:5)
    at async file:///Users/mcanouil/Projects/quarto-dev/quarto-cli/src/quarto.ts:215:3

Reproduction Steps

  1. Open a Quarto project in VSCode
  2. Keep the internal preview browser open
  3. Press the preview button in VSCode
  4. Error occurs consistently

https://github.com/user-attachments/assets/dd8ad7b1-27b8-4c6a-b17b-3d39c20939aa

Expected Behaviour

Preview should work from VSCode UI just as it does from command line.

Actual Behaviour

  • ✅ Works: quarto preview from command line
  • ❌ Fails: Preview button in VSCode with .gitstatus file error

Environment

  • VSCode with Quarto extension
  • The issue appears to be related to how VSCode/extensions handle Git status files
  • macOS

Additional Context

The error suggests Quarto is trying to access a temporary .gitstatus file that may be created by a VSCode extension (possibly a Git extension) but gets cleaned up or moved before Quarto can process it. The issue occurs specifically in the projectResourceFiles function when expanding globs.

Suggested Solution

The team suggests adding .git to the ignore patterns in projectResourceFiles() to prevent this issue, as these temporary Git status files should not be processed as project resources anyway.

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.