You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Window Title]
Error
[Main Instruction]
A JavaScript error occurred in the main process
[Content]
Uncaught Exception:
Error: \\?\C:\Users\Tulio\AppData\Local\Temp\43c7bae1-4b77-45c3-817c-da7016b3c4d0.tmp.node is not a valid Win32 application.
\\?\C:\Users\Tulio\AppData\Local\Temp\43c7bae1-4b77-45c3-817c-da7016b3c4d0.tmp.node
at process.func [as dlopen] (node:electron/js2c/asar_bundle:2:2131)
at Object.<anonymous> (node:internal/modules/cjs/loader:1356:18)
at Object.func [as .node] (node:electron/js2c/asar_bundle:2:2358)
at Module.load (node:internal/modules/cjs/loader:1126:32)
at node:internal/modules/cjs/loader:967:12
at Function._load (node:electron/js2c/asar_bundle:2:13327)
at Module.require (node:internal/modules/cjs/loader:1150:19)
at require (node:internal/modules/cjs/helpers:121:18)
at load (C:\Users\Tulio\AppData\Local\Programs\hathor-wallet\resources\app.asar\node_modules\usb\node_modules\node-gyp-build\node-gyp-build.js:22:10)
at Object.<anonymous> (C:\Users\Tulio\AppData\Local\Programs\hathor-wallet\resources\app.asar\node_modules\usb\dist\usb\bindings.js:8:36)
[OK]
Root Cause Analysis
Why are these errors happening?
Because their packages are loading an invalid executable. Specifically, they are loading a Mach-O executable generated by the usb package which was supposed to be used only in a macOS.
Why?
Because the usb package uses the node-gyp-build package to load the shared object. As the usb package has a build/ folder, it supersedes the prebuilt binaries in the prebuilds/ folder (which contains binaries for all platforms) and the wrong object is loaded.
Why?
Because node-hid cannot load a prebuilt binary so it launches a rebuild which is also rebuilding the usb package using the node-gyp rebuild. But this rebuilding tool does not recognize prebuilt binaries so it actually builds the usb package and creates the build/ folder.
Summary
The following error is happening on Linux:
And the following error is happening on Windows:
Root Cause Analysis
Why are these errors happening?
Because their packages are loading an invalid executable. Specifically, they are loading a Mach-O executable generated by the
usb
package which was supposed to be used only in a macOS.Why?
Because the
usb
package uses thenode-gyp-build
package to load the shared object. As theusb
package has abuild/
folder, it supersedes the prebuilt binaries in theprebuilds/
folder (which contains binaries for all platforms) and the wrong object is loaded.Why?
Because
node-hid
cannot load a prebuilt binary so it launches a rebuild which is also rebuilding theusb
package using thenode-gyp rebuild
. But this rebuilding tool does not recognize prebuilt binaries so it actually builds theusb
package and creates thebuild/
folder.Why?
(pending)
Notes
[email protected]
has already fixed the issue but our dependencies are still using[email protected]
.Quick fix
Here is one quick fix. It works because the removal of this file prevents the usb package from building.
@r4mmer is experimenting using the overrides in package.json to change the dependency of a dependency. But it is still not working.
The text was updated successfully, but these errors were encountered: