Using modules
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- javascript, r
Research direction
Compare the working live-server example with the htmlwidget rendered from the Rmd file using runtime: shiny. Start with /lib/library.min.js and inspect how the widget is included when rendered, focusing on why import.meta is treated outside a module. Done means identifying the rendering difference and documenting or implementing a reproducible resolution.
Written by the indexing model from the issue text.
Description
Perhaps this is just an instance of a larger issue, maybe related to #405 but not quite the same (I don't get the MIME type of "text/plain" error).
I am able to run my code with live-server without issue. I packaged it into an htmlwidget and tried to run it in an Rmd file with runtime: shiny. I get no output, and I get this in the console:
Uncaught SyntaxError: import.meta may only appear in a module
The import.meta does appear in my /lib/library.min.js file, but this error only happens when trying to render the htmlwidget.
Running the same code outside of the htmlwidgets context, i.e. having a js file with import Thing from "/some/lib.js;" and then <script type="module" src="/my-script.js"></script> in my index.html works perfectly using live-server.
I will be happy for even a high-level explanation of what might be going on here, or where to look for solutions.
- Dominant language
- R
- Stars
- 801
- Forks
- 202
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ramnathv/htmlwidgets
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
ramnathv/htmlwidgets#307 · 2 reactions ·
-
Difficulty 3/5 1-2 days Newbie friendliness 52/100
ramnathv/htmlwidgets#495 · 1 reaction ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
ramnathv/htmlwidgets#492 · 2 comments ·
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
ramnathv/htmlwidgets#489 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
ramnathv/htmlwidgets#488 · 1 comment ·
All issues in ramnathv/htmlwidgets
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
BGI-shenzhen/PopLDdecay#25 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Public-Environmental-Data-Partners/EJAM#699 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
waldronlab/bugphyzz#281 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day