Error using Quarto to render a docx

I receive the following error when using quarto to render the default template to a docx.

Error in eval(xfun::parse_only(name)) : object 'docx' not found
Calls: ... create_output_format -> create_output_format_function -> eval -> eval
Execution halted

Rstudio version:
RStudio 2022.02.3+492 "Prairie Trillium" Release (1db809b8323ba0a87c148d16eb84efe39a8e7785, 2022-05-20) for Windows
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) QtWebEngine/5.12.8 Chrome/69.0.3497.128 Safari/537.36

R version:
version.string R version 4.2.0 (2022-04-22 ucrt)
nickname Vigorous Calisthenics

I did intially have an older quarto installed but I have removed quarto and reinstalled the above version of rstudio (with the understanding that it is pre-bundled with the latest quarto). I can render to html without a problem.

Can you share the YAML header you use to get this error ? I am suprised that create_output_format() is called for a Quarto document ?

Running the default template for Quarto document in the IDE works for me

---
title: "Untitled"
format: docx
editor: visual
---

## Quarto

Quarto enables you to weave together content and executable code into a finished document. To learn more about Quarto see <https://quarto.org>.

## Running Code

When you click the **Render** button a document will be generated that includes both content and the output of embedded code. You can embed code like this:

```{r}
1 + 1
```

You can add options to executable code like this

```{r}
#| echo: false
2 * 2
```

The `echo: false` option disables the printing of code (only output is displayed).

Here is the code...

---
title: "Untitled"
format: docx
editor: visual
---

## Quarto

Quarto enables you to weave together content and executable code into a finished document. To learn more about Quarto see <https://quarto.org>.

## Running Code

When you click the **Render** button a document will be generated that includes both content and the output of embedded code. You can embed code like this:

```{r}
1 + 1

You can add options to executable code like this

#| echo: false
2 * 2

The echo: false option disables the printing of code (only output is displayed).

It seems like the same code as mine. Can you render properly the one I shared in Error using Quarto to render a docx - #2 by cderv above ?

This works for me without issue in a fresh RStudio project.

You can try updating also if you can.

I agree they are the same code.
I generated it using the following settings and then hitting the Render button.
Rstudio is the newest according to Help/Check For Updates

I did try the step that you explained above and I can"t reproduce.

Can you share what is printed into the Render Pane (or job pane) when you click on the Render button
image ?

thanks

Thanks for replying so quickly.

Can you share results of RStudio.Version() ?

And system("quarto --version") and Sys.which("quarto") ?

I really don't understand all this. I can't reproduce for now. So we need to check again all the versions. You should update everything if you can also

Thank you for persisting.
I have updated Rstudio already unless you are referring to a development version. If so where can I access the dev vers.
I'm not sure how to update quarto because I thought the bundled version is more recent than what is available at quarto.org.

Here are the details you asked for:

RStudio.Version()
$citation

To cite RStudio in publications use:

  RStudio Team (2022). RStudio: Integrated Development
  Environment for R. RStudio, PBC, Boston, MA URL
  http://www.rstudio.com/.

A BibTeX entry for LaTeX users is

  @Manual{,
    title = {RStudio: Integrated Development Environment for R},
    author = {{RStudio Team}},
    organization = {RStudio, PBC},
    address = {Boston, MA},
    year = {2022},
    url = {http://www.rstudio.com/},
  }


$mode
[1] "desktop"

$version
[1] ‘2022.2.3.492’

$long_version
[1] "2022.02.3+492"

$release_name
[1] "Prairie Trillium"

system("quarto --version")
[1] 127

Sys.which("quarto")
quarto
""

The last two command seem to point out that quarto is not found in RStudio IDE.
but I think this is an issue from WINDOWS: Update add Quarto to PATH by jgutman · Pull Request #11396 · rstudio/rstudio · GitHub that has been recently fixed. Not sure in which version it is though.

If you would like to test latest version, they are here: https://dailies.rstudio.com/

You could try last daily build which would also embed a newer quarto and see what happens

Thank you! It is fixed after installing the Windows10+ 2022.07.0-preview+534.
Thank you for persisting with solving this issue.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.