This pkgdown issue r-lib/pkgdown#2278 appears to have been caused by the code in callr:::make_vanilla_script_expr being evaluated in the wrong context: there's a call in that function to flush(stderr()), and it was calling the stderr() that was defined in the R Markdown document, not the base function.
The function callr:::make_vanilla_script_expr is very complicated, so I can't tell whether this is a bug in it, or a misuse in pkgdown, but for sure defining a function named stderr in a document should not cause the document build to fail.
This pkgdown issue r-lib/pkgdown#2278 appears to have been caused by the code in
callr:::make_vanilla_script_exprbeing evaluated in the wrong context: there's a call in that function toflush(stderr()), and it was calling thestderr()that was defined in the R Markdown document, not the base function.The function
callr:::make_vanilla_script_expris very complicated, so I can't tell whether this is a bug in it, or a misuse inpkgdown, but for sure defining a function namedstderrin a document should not cause the document build to fail.