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

Make the web runtime usable from NodeJS #270

Open
Michael-F-Bryan opened this issue Aug 24, 2021 · 2 comments
Open

Make the web runtime usable from NodeJS #270

Michael-F-Bryan opened this issue Aug 24, 2021 · 2 comments
Labels
area - runtime The Rust Rune runtime category - bug Something isn't working

Comments

@Michael-F-Bryan
Copy link
Contributor

We currently can't use the web bindings out of the browser because the tfjs-tflite package uses browser-specific APIs (e.g. self and Blob).

It'd be really nice if we could run unit tests for our web bindings in CI without needing to start up a browser.

@Michael-F-Bryan Michael-F-Bryan added category - bug Something isn't working area - runtime The Rust Rune runtime labels Aug 24, 2021
@Michael-F-Bryan
Copy link
Contributor Author

Michael-F-Bryan commented Aug 25, 2021

Steps to reproduce:

$ cd bindings/web/
$ yarn test
  yarn run v1.22.5
  $ jest
   PASS  dist/Shape.test.js
      Finished dev [unoptimized + debuginfo] target(s) in 0.36s
       Running `target/debug/rune build /home/michael/Documents/hotg-ai/rune/examples/noop/Runefile.yml --quiet`
  node:internal/process/promises:246
            triggerUncaughtException(err, true /* fromPromise */);
            ^

  [UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by   rejecting a promise which was not handled with .catch(). 
  The promise rejected with the reason "ReferenceError: self is not defined".] {
    code: 'ERR_UNHANDLED_REJECTION'
  }

Note the "ReferenceError: self is not defined" bit.

@Michael-F-Bryan
Copy link
Contributor Author

I've created a ticket for this upstream: tensorflow/tfjs#5532.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area - runtime The Rust Rune runtime category - bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant