Skip to content

[WIP] Electron demo for Transformers.js v3 #52

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

xenova
Copy link
Collaborator

@xenova xenova commented Apr 10, 2025

Running with npm run start works well, but I'm still running into issues when building the application with npm run make.

First:

Uncaught Exception:
Error: dlopen(.../electron.app/Contents/Resources/app.asar.unpacked/node_modules/onnxruntime-node/bin/napi-v3/darwin/arm64/onnxruntime_binding.node, 0x0001): Library not loaded: @rpath/libonnxruntime.1.21.0.dylib

This error can be fixed by adding an override to asar in the electron forge config:

    asar: {
      // Include the native modules in the asar archive
      // https://www.electronforge.io/config/plugins/auto-unpack-natives#usage
      unpack: "{**/{.**,**}/**/*.node,**/{.**,**}/**/*.dylib}",
    },

The next error is more serious... leading to a complete crash with a not-very-readable debug log. The messages still refer to onnxruntime-node, which seems to be the root issue. @fs-eire, I was hoping you could assist in debugging this, since it looks like this affects all electron developers building for production. Thanks!

@fs-eire
Copy link

fs-eire commented Apr 10, 2025

Is that only on macOS or also windows?

@xenova
Copy link
Collaborator Author

xenova commented Apr 18, 2025

Only tested on MacOS, but I can test with windows soon.

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

Successfully merging this pull request may close these issues.

2 participants