I run into the same problem this week. The way to solve it is to install the dev version of distill
.
devtools::install_github("rstudio/distill")
It will prompt you to upgrade your rmarkdown
to a newer version. By doing so, this will resolve the bug (at least in my case).