Skip to content

Getting file not found errror when setting revealjs setting #6809

Open

Description

@hamelsmu

Bug description

In my _quarto.yml file, if I add these options:

format:
  html:
    code-copy: true
    theme: cosmo
    css: styles.css
+  revealjs: 
+    code-line-numbers: false

I get the following error

ERROR: NotFound: No such file or directory (os error 2), rename '/Users/hamel/github/embed-debug-quarto/1_setup/index.html' -> '/Users/hamel/github/embed-debug-quarto/_site/1_setup/index.html'

NotFound: No such file or directory (os error 2), rename '/Users/hamel/github/embed-debug-quarto/1_setup/index.html' -> '/Users/hamel/github/embed-debug-quarto/_site/1_setup/index.html'
    at Object.renameSync (deno:runtime/js/30_fs.js:175:9)
    at renderProject (file:///Applications/quarto/bin/quarto.js:86832:22)
    at async Command.fn (file:///Applications/quarto/bin/quarto.js:90856:32)
    at async Command.execute (file:///Applications/quarto/bin/quarto.js:8437:13)
    at async quarto (file:///Applications/quarto/bin/quarto.js:127545:5)
    at async file:///Applications/quarto/bin/quarto.js:127563:9

Steps to reproduce

I have made a minimal repro here

I am using Quarto 1.3.450

To repro, do the following:

git clone https://github.com/hamelsmu/embed-debug-quarto.git
quarto render

Expected behavior

No response

Actual behavior

No response

Your environment

  • OS: Mac Ventura 13.4.1
  • Quarto v1.3.450

Quarto check output

[✓] Checking versions of quarto binary dependencies...
Pandoc version 3.1.1: OK
Dart Sass version 1.55.0: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
Version: 1.3.450
Path: /Applications/quarto/bin

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

[✓] Checking Python 3 installation....OK
Version: 3.10.12 (Conda)
Path: /Users/hamel/mambaforge/bin/python
Jupyter: 5.3.0
Kernels: python3

[✓] Checking Jupyter engine render....OK

[✓] Checking R installation...........OK
Version: 4.0.4
Path: /Library/Frameworks/R.framework/Resources
LibPaths:
- /Library/Frameworks/R.framework/Versions/4.0/Resources/library
knitr: 1.31
rmarkdown: 2.7

[✓] Checking Knitr engine render......OK

cc: @jjallaire @cscheid

Activity

  1. added
    bug
    on Sep 12, 2023
  2. cscheid commented on Sep 12, 2023

    @cscheid
    Member

    I can repro that here as well. Wild.

  3. added this to the v1.4 milestone on Sep 12, 2023
  4. added
    revealjs
    on Sep 12, 2023
  5. added
    triaged-to
    on Sep 12, 2023
  6. cscheid commented on Sep 12, 2023

    @cscheid
    Member

    (I think @dragonstyle did our line numbering support)

  7. hamelsmu commented on Sep 12, 2023

    @hamelsmu
    ContributorAuthor

    I can repro that here as well. Wild.

    😄 Thank you. I thought I was losing my mind! Hahaha the error didn't make any sense in relation to what I was changing, that is why it took so long for me to isolate this!

  8. cderv commented on Sep 13, 2023

    @cderv
    Member

    FWIW nothing to do with code-line-numbers as I can repro just by adding revealjs: default to the format with same error

    same error message
    > quarto render
    [1/3] 1_setup\1-setup.qmd
    [2/3] 1_setup\index.qmd
    [3/3] index.qmd
    
    ERROR: NotFound: Le fichier spécifié est introuvable. (os error 2): rename 'C:\Users\chris\AppData\Local\Temp\quarto\embed-debug-quarto\1_setup\index.html' -> 'C:\Users\chris\AppData\Local\Temp\quarto\embed-debug-quarto\_site\1_setup\index.html'
    
    Stack trace:
        at Object.renameSync (ext:deno_fs/30_fs.js:215:7)
        at renderProject (file:///C:/Users/chris/Documents/DEV_R/quarto-cli/src/command/render/project.ts:332:14)
        at eventLoopTick (ext:core/01_core.js:181:11)
        at async Command.fn (file:///C:/Users/chris/Documents/DEV_R/quarto-cli/src/command/render/cmd.ts:212:26)
        at async Command.execute (file:///C:/Users/chris/Documents/DEV_R/quarto-cli/src/vendor/deno.land/x/[email protected]/command/command.ts:1790:7)
        at async quarto (file:///C:/Users/chris/Documents/DEV_R/quarto-cli/src/quarto.ts:135:3)
        at async file:///C:/Users/chris/Documents/DEV_R/quarto-cli/src/quarto.ts:167:5
    

    I think what happens is a conflict betwen html and revealjs that both aim to output some HTML files. Those two formats produce HTML so they overwrite each other, but in the case of a project rendering with output-dir set, the moving of file raises an error, because there is only one file to move as both formats have written to the same file.

    Here the detailed explanation of why this happens (not sure you are expecting this behavior)

    Format metadata merging

    Regarding this usage in _quarto.yml, it will be merged with document level format, and I believe this part of the doc is important

    Note that when metadata is combined, objects and arrays are merged rather than simply overwriting each other. (...)
    The one exception to metadata merging is format. If the document-level YAML defines a format, it must define the complete list of formats to be rendered.

    This means to me that if no format is defined at a document level, then both from _quarto.yml level will be used. The file from the error (https://github.com/hamelsmu/embed-debug-quarto/blob/main/1_setup/index.qmd) does not get a format key, so I think it will be rendered to format: html and format: revealjs, and the fact that both produce html makes something trip.

    Setting

    ---
    title: "Setup"
    order: 1
    format: html
    ---

    in the file remove the error.

    Also to verify what I am saying you could try not setting a format in the Document level and use pdf in _quarto.yml

    format:
      html:
        code-copy: true
        theme: cosmo
        css: styles.css
      pdf: default

    After quarto render, a pdf file for 1_setup/index.qmd will be produced.
    Now add back the format: html in this qmd file -> No PDF file is rendered at all. The format for pdf defined in _quarto.yml is completely ignored by quarto render because

    • No file use it in their document level
    • No file has no format define as document level.

    This happens at

    // If the file itself has specified permissible
    // formats, filter the list of formats to only
    // include those formats
    if (file.formats) {
    formats = formats.filter((format) => {
    return file.formats?.includes(format);
    });

    This way of merging project formats with other format metadata is the default one - only book project only consider project format only.

    About the missing index.html

    I believe this is the same as #4470 for revealjs and HTML, and close to #1929 about multiple markdown output format

    Quarto currently have no way to track all this correctly and so a format producing .html will overwrite a previous one producing also a .html (Next big improvement probably - #6518)

    Error is from

    // move the renderedFile to the output dir
    if (!renderedFile.isTransient) {
    const outputFile = join(formatOutputDir, renderedFile.file);
    ensureDirSync(dirname(outputFile));
    Deno.renameSync(join(projDir, renderedFile.file), outputFile);
    }

    and this happens for each output file. format: html and format: revealjs have the same output file, so it errors because there is only one to move

    Anyhow, sorry for long post. It is not the first time this happens so now we have a written explanation until #6518 helps us solve all this.

  9. modified the milestones: v1.4, v1.5 on Nov 29, 2023
  10. modified the milestones: v1.5, Future on Feb 12, 2024
  11. removed
    triaged-to
    on Nov 14, 2024
  12. mcanouil commented on Jul 14, 2025

    @mcanouil
    Collaborator
  13. andrewpbray commented on Feb 23, 2026

    @andrewpbray

    FWIW I also hit this bug with the minimal revealjs: default setting, in this case in the _quarto.yml file. As I look at the metadata that I need for my usecase, that setting wasn't necessary at all, so it's easy to remove, but it sure was a perplexing error message that took some time to troubleshoot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugrevealjs

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions