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

Test and document how to bundle webR with Skypack for Observable notebooks #250

Open
imathews opened this issue Aug 17, 2023 · 3 comments
Open
Labels
docs Improvements or additions to documentation tidy-dev-day 🤓

Comments

@imathews
Copy link

The ability to leverage R statistics within an interactive Observable notebook could be incredibly powerful. Observable utilizes Skypack to bundle external libraries. When I attempt to do this for webr (https://cdn.skypack.dev/[email protected]), I get the following error:

/*
 * [Package Error] "[email protected]" could not be built. 
 *
 *   [1/5] Verifying package is valid…
 *   [2/5] Installing dependencies from npm…
 *   [3/5] Building package using esinstall…
 *   Running esinstall...
 *   ENOENT: no such file or directory, open 'webr/dist/repl.mjs'
 *   ENOENT: no such file or directory, open '/tmp/cdn/_aFiBbALhfvDaTW6dWLk8/node_modules/webr/dist/repl.mjs'
 *
 * How to fix:
 *   - If you believe this to be an error in Skypack, file an issue here: https://github.com/skypackjs/skypack-cdn/issues
 *   - If you believe this to be an issue in the package, share this URL with the package authors to help them debug & fix.
 *   - Use https://skypack.dev/ to find a web-friendly alternative to find another package.
 */

console.warn("[Package Error] \"[email protected]\" could not be built. \n[1/5] Verifying package is valid…\n[2/5] Installing dependencies from npm…\n[3/5] Building package using esinstall…\nRunning esinstall...\nENOENT: no such file or directory, open 'webr/dist/repl.mjs'\nENOENT: no such file or directory, open '/tmp/cdn/_aFiBbALhfvDaTW6dWLk8/node_modules/webr/dist/repl.mjs'");
throw new Error("[Package Error] \"[email protected]\" could not be built. ");
export default null;
@georgestagg georgestagg added the bug Something isn't working label Aug 18, 2023
@georgestagg
Copy link
Member

Thanks for reporting this, it looks like our package.json needs a little work. I'll take a look at tidying things up for a 0.2.1 patch release.

A corrected package.json should hopefully solve this issue.

@georgestagg
Copy link
Member

This should hopefully work better as of [email protected]. The url https://cdn.skypack.dev/[email protected] seems to work now, but I have not yet tested importing the module into a wider Observable/Skypack project.

@Fil
Copy link

Fil commented Sep 28, 2023

Now it seems to load both with import("https://cdn.skypack.dev/[email protected]") and import("https://esm.sh/[email protected]"). (However I don't know how to instantiate it with the wasm file, nor how to use it.)

@georgestagg georgestagg changed the title Error when bundling with Skypack for Observable notebooks Test and document how to bundle webR with Skypack for Observable notebooks Sep 28, 2023
@georgestagg georgestagg added docs Improvements or additions to documentation and removed bug Something isn't working labels Sep 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to documentation tidy-dev-day 🤓
Projects
None yet
Development

No branches or pull requests

3 participants