Error when loading Quarto html with OJS cells #5680
Replies: 4 comments 14 replies
-
Could you share a small "working" (reproducible) example to work with, i.e., a complete Quarto document or a Git repository? Thanks. You can share a Quarto document using the following syntax, i.e., using more backticks than you have in your document (usually four ````qmd
---
title: "Reproducible Quarto Document"
format: html
---
This is a reproducible Quarto document using `format: html`.
It is written in Markdown and contains embedded R code.
When you run the code, it will produce a plot.
```{r}
plot(cars)
```
The end.
```` |
Beta Was this translation helpful? Give feedback.
-
I have not tried it with latest Quarto changes, and as we established, it is not perfect. The problem seems to be dynamic module loading.
…--Roman
|
Beta Was this translation helpful? Give feedback.
-
@rafazaya & @cscheid: I would like to add to the answer of cscheid on how to create a local web server that mongoose might be a decent option especially when sharing the OJS Quarto documents with non-tech people who are unlikely to have Python/Quarto installed and using a hosting provider is not an option. The advantage of mongoose is that it is tiny (92kB on my machine) compared to Python/Node server and does not require any additional setup. You just copy the mongoose.exe (exe is for Windows) to the same folder where you have your Quarto html document, double click it and then open http://localhost:8000 in your browser (e.g. Google Chrome). If you want to make it slightly easier for your users, you can use command line code below (again for Windows) that I put into something like
|
Beta Was this translation helpful? Give feedback.
-
@cscheid I also experienced something that @resmartiZH describes. After upgrading from an oldish version of Quarto where OJS worked, OJS does not seem to be working anymore in the most recent version for Quarto html with OJS opened without a web server. I agree it is a good idea to warn users that OJS may not work 100%. However, introducing changes that deliberetly break something that previously worked does not seem great. What is the aim? To encourage people to use a web server? Isn't it possible without breaking the code that may work? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
After doing "quarto render file.qmd --to html" I am unable to double click and view the html file. Here is the error. It does as stated work from a web server i.e. with preview.
"The OJS runtime does not work with file:// URLs. Please use a web server to view this document."
https://quarto.org/docs/interactive/ojs/
"OJS works in any Quarto document (plain markdown as well as Jupyter and Knitr documents). Just include your code in an {ojs} executable code block. The rest of this article explains the basics of using OJS with Quarto."
This gives me the impression Quarto documents with OJS should behave the same. Am I missing something? I'm keen to produce a html with OJS that I can share and the end user click to open the file.
Many thanks,
Harry
Beta Was this translation helpful? Give feedback.
All reactions