Closed TheZetner closed 3 months ago
Confirmed this fails non-shiny examples as well
I'm unable to reproduce this error, your package and site builds fine on my machine.
Can you try running pkgdown::clean_site()
and pkgdown::clean_cache()
, devtools::document()
, and then re-build?
After clean_site it's now working fine on both packages. Thanks for the quick response!
I'll be sure to clean site if I see any weird errors in the future. I didn't run clean_cache()
as it's not in pkgdown, was that from a different package?
oops, clean_cache()
is only in dev pkgdown.
I started having weird issues again with 2.1.0, traced it to something deep in build_home()
calling print_yaml()
with some mentions of cache in .Last.error
. Installed dev version, cleaned cache, and now it's working perfectly. So thanks for mentioning clean_cache
as a dev option!!
Hey! First of all, thanks for the awesome on-ongoing work with the package, that keep bringing documentation easily to every useRs! :heart:
I've also experienced the same issue as @TheZetner as in the first message. Bumping to dev version (ee72108bc3a9827dcf313817525652dbd9d4284d) and using clean_site()
and clean_cache()
restart repeatedly did not solve.
Running build_site(examples = FALSE)
does not trigger the error.
Regarding YAML files, I did needed to bump yaml
from v2.3.7 to v2.3.8 as 'verbatim_logical' is not an exported object from 'namespace:yaml'
but your issue seems different in that regard @TheZetner
Best,
Start by installing the latest version of httr2.
@jayhesselberth @hadley I'm having the same error, with pkgdown 2.1.1, httr2 1.0.5.
I run pkgdown::clean_site(), pkgdown::clean_cache(), devtools::document() before building the reference, but it didn't help.
# > pkgdown::build_reference()
Error in `build_reference()`:
! Failed to parse Rd in a_test_function.Rd
Caused by error in `output_handler$source()`:
! argument "expr" is missing, with no default
Backtrace:
▆
1. ├─pkgdown::build_reference()
2. │ ├─pkgdown:::unwrap_purrr_error(...) at pkgdown/R/build-reference.R:188:3
3. │ │ └─base::withCallingHandlers(...) at pkgdown/R/utils.R:39:3
4. │ └─purrr::map(...) at pkgdown/R/build-reference.R:188:3
5. │ └─purrr:::map_("list", .x, .f, ..., .progress = .progress) at purrr/R/map.R:129:3
6. │ ├─purrr:::with_indexed_errors(...) at purrr/R/map.R:174:3
7. │ │ └─base::withCallingHandlers(...) at purrr/R/map.R:201:3
8. │ ├─purrr:::call_with_cleanup(...) at purrr/R/map.R:174:3
9. │ └─pkgdown (local) .f(.x[[i]], ...)
10. │ ├─base::withCallingHandlers(...) at pkgdown/R/build-reference.R:280:3
11. │ └─pkgdown:::data_reference_topic(...) at pkgdown/R/build-reference.R:280:3
12. │ └─pkgdown:::run_examples(...) at pkgdown/R/build-reference.R:367:5
13. │ └─pkgdown:::highlight_examples(code, topic, env = env) at pkgdown/R/rd-example.R:36:5
14. │ └─downlit::evaluate_and_highlight(...) at pkgdown/R/highlight.R:57:3
15. │ └─evaluate::evaluate(code, child_env(env), new_device = TRUE, output_handler = output_handler) at downlit/R/evaluate.R:46:3
16. │ └─evaluate:::evaluate_call(...)
17. │ └─output_handler$source(source)
18. └─base::.handleSimpleError(...) at pkgdown/R/highlight.R:32:5
19. └─pkgdown (local) h(simpleError(msg, call))
20. └─cli::cli_abort(...) at pkgdown/R/build-reference.R:288:7
21. └─rlang::abort(...) at cli/R/rlang.R:45:3
If I don't run the examples, it worked fine build_reference(examples = FALSE)
. The function is very simple
#' test func
#' @export
#' @return NULL
#' @examples
#' 1 + 1
a_test_function <- function() {}
I managed to fix it by upgrading evaluate
according to this issue https://github.com/r-lib/pkgdown/issues/2740
I've found after updating pkgdown from 2.0.9 to 2.1.0 that site building fails on the
build_reference
step when I have examples in my Rd documents. These failures go away when I delete the examples and persist even if the examples are labelled with\dontrun{}
or commented out in the roxygen headers (#' # examplecode
).I've debugged fairly deeply into the nested functions of
build_site()
(build_reference > build_reference_topic > data_reference_topic > run_examples
) but frankly was out of my depth by the lowest point there.The error I've been getting is:
.lastError
returns the following:I've made a branch showing this behaviour in a very small package here: https://github.com/TheZetner/esckey/tree/failingbuild
For now I'm just cutting the examples (as they're super minimal for esckey) but this is an issue for rebuilding my more complex sites where I've simply reverted to pkgdown 2.0.9.
Lastly I love this package! I've used it for several packages now and it just makes documentation and presentation a breeze. Thanks for it!
Cheers, Adrian