@jrlewi Thank you so much for pointing me to this direction! The function 'sans_ext' was indeed removed from the 'knitr' package. I downgraded both 'knitr' and 'rmarkdown' packages, and it worked!
I have one error message but it does not seem to affect the website. The error message is:
Error in as.vector(x, "character") :
cannot coerce type 'environment' to vector of type 'character'
I tried old version of 'xfun' but it didn't solve the above problem. I cannot use old versions of 'later' and 'httpuv' because serve_site seems to force me to use the latest 'httpuv' and 'later' packages.
Your advice saved me lots of time.