webr
webr copied to clipboard
Test and document how to bundle webR with Skypack for Observable notebooks
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;
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.
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.
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.)