I recently came across DataCamp's tutorial package that makes code chunks within an R Markdown document interactive by opening the code chunks in DataCamp's learning interface. I used tutorial::build_example() to generate an example file and compiled it to see how the rendered html file looks. It works as expected. Since I wanted to use this feature in xaringan slides, I changed output: html_document to output: xaringan::moon_reader and now I see this:
I am wondering why this is failing in xaringan slides and how can I fix it?

