Skip to content

npx quartz serve crashes when renaming files #2232

@husjon

Description

@husjon

Describe the bug
When a markdown file is renamed in the content/ folder while npx quartz serve --build is running, it crashes with the error message:

Failed to process markdown `content/Untitled.md`: ENOENT: no such file or directory, open '/tmp/quartz/content/Untitled.md'

To Reproduce
Steps to reproduce the behavior:

  1. git clone https://github.com/jackyzha0/quartz.git
  2. cd quartz
  3. npm i
  4. npx quartz build --serve
  5. Create index file touch index.md
  6. Create a second file (e.g. Untitled.md), for example using touch Untitled.md
  7. Rename the file to something else (e.g. test.md) On Linux/Mac this would be using mv Untitled.md test.md
  8. Observe the server failing to process the markdown file.

Expected behavior
The file existence should be checked prior to processing and the server should continue running.

Screenshots and Source
Here's a quick video showing the steps to reproduce this.
This is using the latest commit on main (13ff64d)

https://www.youtube.com/watch?v=j2QhrmlGOv8

Desktop (please complete the following information):

  • Quartz Version: v4.5.2 (also tested using latest main)
  • node Version: v22.21.1
  • npm version: 10.9.4
  • OS: NixOS 26.05 (Yarara)
  • Browser: Vivaldi

Additional context
None

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions