After trying to build a PDF that worked ~2 weeks ago, no fuss, on a new machine with a fresh install of R, R studio, bookdown, etc, I have this error:
Update: This has been fixed in the dev version of bookdown: https://github.com/rstudio/bookdown You can install it via remotes::install_github('rstudio/bookdown').
This might be related to a recent feature in bookdown. Since you didn't provide a reproducible example, my blind guess is that setting options(bookdown.render.file_scope = FALSE) might fix it. You can set this option in either your Rmd document or ~/.Rprofile.