Shiny server does not allow local OJS/js module imports
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- javascript, r
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- TypeScript
- Stelle
- 645
- Fork
- 62
- Merge medio
- 17h 42m
- PR unite (30g)
- 13
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di quarto-dev/quarto
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
quarto-dev/quarto#1099 ·
-
vscode
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
quarto-dev/quarto#934 · 1 commento · 2 reazioni ·
-
vscode
Difficoltà 5/5 Più di una settimana Idoneità per principianti 42/100
quarto-dev/quarto#1130 ·
-
vscode
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
quarto-dev/quarto#1122 ·
-
Local Zotero library: new or edited items do not appear until Zotero checkpoints its WAL file Apertabug vscode zotero
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
quarto-dev/quarto#1119 · 1 commento ·
Tutte le issue di quarto-dev/quarto
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
area:tools bug good first issue help wanted priority:P2
Difficoltà 2/5 1-3 ore Idoneità per principianti 90/100
TaewoooPark/Motifcode#14 ·
-
bug 🐞
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
[Bounty proposal] fix(web): memory insights count an evening memory on the next day ($25 proposed) Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
BasedHardware/omi#15320 ·
-
Difficoltà 2/5 Mezza giornata Idoneità per principianti 78/100
vercel/vercel-plugin#199 ·