-
-
Notifications
You must be signed in to change notification settings - Fork 878
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error rendering errorneous code in R chunk (maybe rlang errors specifically?) #2366
Comments
Thanks for the report. I believe this is linked to newest evaluate version. Though it is not related to Quarto directly. It happens in Quarto because R is ran is a background session, and it seems to be the problem; I can reproduce with knitr only
I'll look into it. |
This is probably where the problem is coming from |
So here is more minimal example ---
title: "test"
---
```{r error = FALSE}
rlang::abort("Test")
```
Using Render button on RStudio IDE will run this in background session and we get
Running in R console leads to the same error
And > knitr::knit("test.Rmd")
processing file: test.Rmd
|.............................................................................................................................................................| 100% [unnamed-chunk-1]Error in `!continue`:
! type de l'argument incorrect
Backtrace:
1. knitr::knit("test.Rmd")
2. knitr:::process_file(text, output)
5. knitr:::process_group(group)
6. knitr:::call_block(x)
7. knitr:::block_exec(params)
8. knitr:::eng_r(options)
11. knitr (local) evaluate(...)
12. evaluate::evaluate(...)
Quitting from lines 6-7 [unnamed-chunk-1] (test.Rmd) I can't reproduce with evaluate only so I need to look closer on how this works |
The upstream has fixed the issue and I tested this will fix this issue, a potential improvement on error reporting we can continue on #2369 |
Reproduction:
Put this incorrect code in an empty Rmd or Quarto file (can't reproduce on reprex for some reason).
For reproduction, I tried (1) the latest conda-forge and (2) my local environment which has updated all packages, latest R on my distro and pulled the github version of knitr as you requested, both exhibit this issue:
I was expecting to see the ggplot error telling me this makes no sense, but I get this:
This happens a lot in my real work recently and I don't remember it happening before and I had to resort to manually attaching
error=true
to the chunk to get the real error. I have these thoughts:Thanks!
For conda reproduction:
By filing an issue to this repo, I promise that
xfun::session_info('knitr')
. I have upgraded all my packages to their latest versions (e.g., R, RStudio, and R packages), and also tried the development version:remotes::install_github('yihui/knitr')
.I understand that my issue may be closed if I don't fulfill my promises.
The text was updated successfully, but these errors were encountered: