Shiny server does not allow local OJS/js module imports
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 35/100
- Issue-Typ
- Bug
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Veraltet
- Tech-Stack
- javascript, r
Rechercherichtung
Reproduce the failure with square.js and the minimal Quarto document using server: shiny, comparing it with the working non-Shiny document. Start by tracing how the local JavaScript module is served during Shiny rendering; done means the local OJS import loads and square(5) works in the Shiny document without the MIME-type error.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Problem:
When trying to import a local module for OJS as outlined here when server: shiny, an error occurs and the module cannot be used. The module is found, otherwise the error will occur on initial build and the render will fail, but it is unable to be imported. This does not happen if the shiny server is not used. It would be useful to be able to store OJS code (such as functions that can make plots) as a .qmd module and import it into a quarto document running with a shiny server to feed in the data.
Currently this is the error that occurs:
Error: error loading dynamically imported module Loading module from “http://localhost:6366/square.js” was blocked because of a disallowed MIME type (“text/html”)
Minimal Example:
square.js:
export function square(x) { return x * x; }
This works:
---
title: "Module Import Test"
format: html
---
```{ojs}
//| echo: true
//| output: true
import { square } from "./square.js";
square(5);
```
This does not:
---
title: "Module Import Test"
format: html
server: shiny
---
```{ojs}
//| echo: true
//| output: true
import { square } from "./square.js" // This recieves an error and square is undefined.
square(x)
```
```{ojs}
x * x // This code is able to run perfectly fine
```
```{r}
#| context: server
#| echo: true
x <- reactive(5)
ojs_define(x)
```
Environment Information
Quarto Version: 1.7.6
Browser: Firefox & Chrome
Shiny Version: 1.10.0
R Version: 4.4.2
- Vorherrschende Sprache
- TypeScript
- Sterne
- 645
- Forks
- 62
- Ø Merge
- 17 Std. 42 Min.
- Gemergte PRs (30 T.)
- 13
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus quarto-dev/quarto
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 90/100
quarto-dev/quarto#1099 ·
-
vscode
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
quarto-dev/quarto#934 · 1 Kommentar · 2 Reaktionen ·
-
vscode
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 42/100
quarto-dev/quarto#1130 ·
-
vscode
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 68/100
quarto-dev/quarto#1122 ·
-
bug vscode zotero
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 48/100
quarto-dev/quarto#1119 · 1 Kommentar ·
Alle Issues in quarto-dev/quarto
Ähnliche Issues
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P3
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 76/100
-
code-quality refactoring
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100
langchain-ai/deepagents#6450 ·
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 88/100
vercel/react-tweet#225 ·