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

unable to load an R package into a Node.js Electron application #510

Open
dusadrian opened this issue Jan 22, 2025 · 0 comments
Open

unable to load an R package into a Node.js Electron application #510

dusadrian opened this issue Jan 22, 2025 · 0 comments

Comments

@dusadrian
Copy link

dusadrian commented Jan 22, 2025

Having managed to successfully mount a VFS library, I am now on a quest to develop an Electron application under Node.js, that would use base R and some other contributed packages.

Everything works as expected, except that I am unable to load an R package even if mounting the VFS library succeeds. I put together a simple GitHUb repo for replication, on https://github.com/dusadrian/webrapp/

I have a series of questions on how to use the WebR package, commented in the file main.ts:

  1. Line 31 with let output = await result.toArray(); does not work, unless inserting line 27. I have no idea why, at least in Typescript this is the only way I could proceed forward.

EDITED: this point is now solved, having found and read the section Typing an object

  1. Between lines 38:41, following guidance from other issues, I first used let data = fs.readFileSync('/some/local/path/library.data'); which did not work in my case unless enveloping everything into a new Blob()

These two points are now clear, but the part I still seem to get stuck is:

  1. on line 58, where I was supposed to load the (only) package in the mounted VFS library. Mounting works alright, since list.files() does report the package directory as per line 59.

Any further hint would be highly appreciated,
Adrian

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

No branches or pull requests

1 participant