Skip to content
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

module import in Quarto #30

Closed
neocarto opened this issue Mar 21, 2022 · 5 comments
Closed

module import in Quarto #30

neocarto opened this issue Mar 21, 2022 · 5 comments

Comments

@neocarto
Copy link
Member

neocarto commented Mar 21, 2022

Currently, require("bertin") does'nt work in Quarto. The following error is returned: OJS Error. RequireError$1: invalid module. To import bertin, I have to write: bertin = import('https://cdn.skypack.dev/bertin@0.9'). However, require works in Observable. It's weird... See also https://talk.observablehq.com/t/quarto-module-require/6573 & https://stackoverflow.com/questions/72300480/error-quarto-require-invalid-module-bertin-js
Screenshot from 2022-05-19 10-53-08
Actually, it's very weird. There is an error in rstudio. But when I deploy the page in github (see), the error disappears.

@cscheid
Copy link

cscheid commented May 19, 2022

(Quarto dev here) This commit from yesterday addresses a bug in our version of d3-require (which we need for interoperability with imports from ipython's html widgets). Could you upgrade to the latest quarto version and test that? Thanks!

@neocarto
Copy link
Member Author

The problem is not solved with quarto 0.9.434 :(

@cscheid
Copy link

cscheid commented May 20, 2022

Huh, weird. This is what it looks like for me locally:

image

Edit: Ok, I see the difference now - I'm running the preview on VS Code, you're on RStudio IDE. It seems that the issue is specific to the interaction between RStudio IDE and d3-require. I'll investigate further.

@neocarto
Copy link
Member Author

Within Rstudio :

  • It works if I choose "Preview in window". Output in localhost is ok.
  • It doesn't work if I choose "Preview in Viewer Pane". Cf screenshot above.

@neocarto
Copy link
Member Author

Solved : quarto-dev/quarto-cli#943

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants