-
-
Notifications
You must be signed in to change notification settings - Fork 979
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
shiny_prerendered
parses DESCRIPTION
file from wrong location
#2540
Comments
Thanks for the report @nanxstats! This seems specific to learnr, or have you seen this behavior with other rmarkdown formats? If not, I'll move this over to the learnr bug tracker. |
@gadenbuie Sure thing. I think this issue is more prevalent for learnr projects because it's probably a major source of usage of the |
@nanxstats Can you try this with another shiny prerendered document that isn't a learnr tutorial? Does it also create problematic behavior under similar circumstances (where an unrelated DESCRIPTION file exists in a parent directory)? |
@gadenbuie Good idea. I further tried the two examples in Prerendered Shiny Documents with Also, here is a slightly updated minimal reproducible example - it gives a better hint on where the error happened (a usethis::create_project("example")
# In the new project
usethis::use_description()
writeLines(append(readLines("DESCRIPTION"), "Imports", after = 1), "DESCRIPTION")
fs::file_move("DESCRIPTION", "~/DESCRIPTION")
rmarkdown::draft("example.Rmd", template = "tutorial", package = "learnr", create_dir = FALSE, edit = FALSE) Run document:
|
@gadenbuie do you want to move this issue then as it seems learnr related ? Though we do read dcf in this code base when handling dependencies rmarkdown/R/shiny_prerendered.R Lines 330 to 353 in 07e2a99
We do try to find project root but related to a dependency file. Is there also a read dcf call in learnr ? Or would this be this one ? |
Under specific conditions, rmarkdown/learnr incorrectly searches for and attempts to parse a
DESCRIPTION
file outside the intended project directory. This issue arises if theDESCRIPTION
file contains errors such as formatting issues, causing the quiz component to remain in a "loading" state. This state persists without providing an error message to identify the issue for developers or users.In Posit Workbench, this problem becomes a HTTP 500 error in the Chrome DevTools Network tab, with a possible DCF parsing error message in the response.
Minimal reproducible example
In the new project window, run
Open
example.Rmd
, run the document, and navigate to "Topic 2". The quiz will display "Loading..." instead of the content.Session info
Checklist
When filing a bug report, please check the boxes below to confirm that you have provided us with the information we need. Have you:
formatted your issue so it is easier for us to read?
included a minimal, self-contained, and reproducible example?
pasted the output from
xfun::session_info('rmarkdown')
in your issue?upgraded all your packages to their latest versions (including your versions of R, the RStudio IDE, and relevant R packages)?
installed and tested your bug with the development version of the rmarkdown package using
remotes::install_github("rstudio/rmarkdown")
?The text was updated successfully, but these errors were encountered: