Skip to content

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.

@PaUl1481980

This comment has been minimized.

@MaSeOG
Copy link

MaSeOG commented May 24, 2025

All good?

@ddiddi
Copy link

ddiddi commented Jun 6, 2025

LGTM!

@xenova xenova marked this pull request as ready for review July 31, 2025 00:40
@xenova xenova changed the title [WIP] Electron demo for Transformers.js v3 Electron demo for Transformers.js v3 Jul 31, 2025
@xenova xenova merged commit 8abc617 into main Jul 31, 2025
@xenova xenova deleted the new-electron-demo branch July 31, 2025 00:42
@xenova
Copy link
Collaborator Author

xenova commented Jul 31, 2025

Merging for now -- haven't been able to test on windows yet, but npm run start works well. Hoping to solve the building on mac 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.

5 participants