Shiny server does not allow local OJS/js module imports
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 35/100
- Tipo de issue
- Bug
- Clareza
- Razoavelmente clara
- Status de atividade
- Estagnada
- Stack de tecnologia
- javascript, r
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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
- Linguagem predominante
- TypeScript
- Estrelas
- 645
- Forks
- 62
- Merge médio
- 17h 42min
- PRs com merge (30d)
- 13
Guia de contribuição
Nenhum guia de contribuição indexado para este repositório
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de quarto-dev/quarto
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 90/100
quarto-dev/quarto#1099 ·
-
vscode
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
quarto-dev/quarto#934 · 1 comentário · 2 reações ·
-
vscode
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 42/100
quarto-dev/quarto#1130 ·
-
vscode
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 68/100
quarto-dev/quarto#1122 ·
-
Local Zotero library: new or edited items do not appear until Zotero checkpoints its WAL file Abertabug vscode zotero
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 48/100
quarto-dev/quarto#1119 · 1 comentário ·
Todas as issues de quarto-dev/quarto
Issues semelhantes
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P3
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 76/100
-
code-quality refactoring
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 74/100
langchain-ai/deepagents#6450 ·
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 88/100
vercel/react-tweet#225 ·