quarto-dev / quarto-dev/quarto-cli

In quarto render, "--output -" is incompatible with "--embed-resources"

Open
#7,984 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Bug description

In quarto render, simultaneous use of the options --output - and --embed-resources fails with an error (file not found). This error occurs after the HTML file is generated and printed to stdout.

Steps to reproduce
$ touch example.qmd

$ quarto render example.qmd --output -
# ... runs without errors, printing HTML to stdout

$ quarto render example.qmd --output - --embed-resources
# ... the HTML is printed to stdout without issue, but then an error appears:
ERROR: NotFound: No such file or directory (os error 2)

NotFound: No such file or directory (os error 2)
    at Object.readTextFileSync (deno:runtime/js/40_read_file.js:42:16)
    at pandocIngestSelfContainedContent (file:///home/ning/miniconda3/envs/togarep/bin/quarto.js:80935:27)
    at file:///home/ning/miniconda3/envs/togarep/bin/quarto.js:81087:27
    at async withTimingAsync (file:///home/ning/miniconda3/envs/togarep/bin/quarto.js:19633:25)
    at async Object.complete (file:///home/ning/miniconda3/envs/togarep/bin/quarto.js:81082:13)
    at async Object.onPostProcess (file:///home/ning/miniconda3/envs/togarep/bin/quarto.js:86678:36)
    at async renderFiles (file:///home/ning/miniconda3/envs/togarep/bin/quarto.js:86649:13)
    at async render (file:///home/ning/miniconda3/envs/togarep/bin/quarto.js:90681:21)
    at async Command.fn (file:///home/ning/miniconda3/envs/togarep/bin/quarto.js:90856:32)
    at async Command.execute (file:///home/ning/miniconda3/envs/togarep/bin/quarto.js:8437:13)
Expected behavior

No error.

Actual behavior

Error.

Your environment

quarto on command line, installed via mamba (from conda-forge).

Quarto check output
$ quarto check

[✓] Checking versions of quarto binary dependencies...
      Pandoc version 3.1.1: OK
      Dart Sass version 1.58.3: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
      Version: 1.3.450
      Path: /home/ning/miniconda3/envs/togarep/bin

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

[✓] Checking Python 3 installation....OK
      Version: 3.11.7 (Conda)
      Path: /home/ning/miniconda3/envs/togarep/bin/python
      Jupyter: (None)

      Jupyter is not available in this Python installation.
      Install with conda install jupyter

[✓] Checking R installation...........(None)

      Unable to locate an installed version of R.
      Install R from https://cloud.r-project.org/

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.

Research direction

Reproduce the failure with quarto render example.qmd --output - --embed-resources, then inspect the post-processing path named in the trace, especially pandocIngestSelfContainedContent and onPostProcess. Trace how the output path is handled after HTML is written to stdout. Done means the command exits without the file-not-found error while still printing the HTML.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.