NodeRT icon indicating copy to clipboard operation
NodeRT copied to clipboard

Client errors: The specified module could not be found after including @nodert-win10-rs4\windows.security.credentials.ui

Open cscharf opened this issue 5 years ago • 6 comments
trafficstars

Overview

We have recently implemented Windows Hello and biometric capabilities for our app using @nodert-win10-rs4\windows.security.credentials.ui. While our development machines, and a decent percentage of our users are not experiencing any issues, and our build pipeline/agents, etc. are not having issues, a large number of folks are reporting a JavaScript error when starting up our app, and the trace on the screen points directly to this newly added dependency.

Exception

Error: The specified module could not be found.
\?\C:\Users\Frodo\AppData\Local\Temp\4a2f6f06-7c8b-4661-8fcf-43ab2cd758f6.tmp.node
   at process.func (electron/js2c/asar.js:138:31)
   at process.func [as dlopen] (electron/js2c/asar.js:138:31)
   at Object.Module._extensions..node (internal/modules/cjs/loader.js:828:18)
   at Object.func (electron/js2c/asar.js:138:31)
   at Object.func [as .node] (electron/js2c/asar.js:147:18)
   at Module.load (internal/modules/cjs/loader.js:645:32)
   at Function.Module._load (internal/modules/cjs/loader.js:560:12)
   at Module.require (internal/modules/cjs/loader.js:685:19)
   at require (internal/modules/cjs/helpers.js:16:16)
   at Object. (C:\Program Files\Bitwarden\resources\app.asar\node_modules@nodert-win10-rs4\windows.security.credentials.ui\lib\main.js:25:20)

Environment(s)

OS (where crash is occurring)

  • Windows 7 Pro SP1-3
  • Windows 7 Home Premium SP1
  • Windows 8.1 Home
  • Windows 10 Pro build 2004
  • Windows 10 Home build 2004

Build:

We're using electron-builder to package our app for distribution node v10.16.0

Module Version:

@nodert-win10-rs4\windows.security.credentials.ui: ^0.4.4

Things We've Tried (that have not worked)

  1. Reboots
  2. Reinstalls
  3. Clean uninstall, re-install, reboot
  4. Run as Administrator
  5. Steps described in #87
  6. Running scans with DependencyWalker
  7. Running scans with Dependencies
  8. Convincing folks to use Linux

Steps to Reproduce

  1. install Bitwarden Desktop client for Windows (Windows Store, Direct Download, all the same issue)
  2. Run application

Expected Behavior

Application should operate without crashing for versions of Windows without Windows Hello capabilities and for those systems with should enable those through the application.

Actual Behavior

Application immediately crashes with the noted JavaScript Exception deriving from the module loading within @nodert-win10-rs4\windows.security.credentials.ui

Additional Details

see: https://github.com/bitwarden/desktop/issues/495 source code: https://github.com/bitwarden/desktop build cmd: npm run build

We truly need some assistance in understanding the dependency tree that this module is accessing and needs at run-time to operate and work as expected, and why electron-builder is not packaging the necessary dependencies for this during build-time.

cscharf avatar Jul 31 '20 02:07 cscharf

I am also having problems with NodeRT modules. It works on regular Windows 10 but not on Windows 10 S Mode. @cscharf can you confirm if the crashes you are having only happen on Windows 10 S?

markibanez avatar Jul 31 '20 06:07 markibanez

The crashes are happening on Windows 10 and Windows 7 both, same crash. We did find for a good number of folks, having them install the latest VC++ Redistributable package from Microsoft (2015, 2017, and 2019 combined version) resolved the issue and installed the necessary dependency.

I'm not sure if this is an issue with NodeRT in listing/pulling appropriate dependencies, or if this is an issue with electron-builder not properly linking them during compilation. Other native node modules we're using are properly pulling in dll dependencies that they need (such as keytar, etc.).

cscharf avatar Jul 31 '20 10:07 cscharf

@markibanez , my assumption would be that there likely are missing dependencies using Windows 10 in S Mode given that it doesn't load or allow some select developer tools, which are likely also embodied in the VC++ redistributable. This particular issue for us seems to be happening on all versions of Windows in all modes (7, 7SP1, 7SP3, 8.1, and 10) so I would assume S Mode is also likely impacted.

cscharf avatar Jul 31 '20 11:07 cscharf

And... this may have something to do with S Mode regarding the Store issue: https://stackoverflow.com/questions/38731571/uwp-windows-10-wack-tests-errors

cscharf avatar Jul 31 '20 11:07 cscharf

@cscharf you're right. It has to do with NodeRT not bundling VC++ redistributable DLLs. As stated by @Janneman84 in #87 all that needs to be done is copy it in the package. So I just included them in my packaged electron app and built the appx. Tested it in Windows 10 S and it worked :)

markibanez avatar Jul 31 '20 13:07 markibanez

Thanks @markibanez , although we had tried that, perhaps we missed one of the DLLs so I'll dig in and try a bit more. It feels a bit dirty going that route and I'm pretty sure there may be platform specific issues for our users running x86 vs. 64-bit systems. Will need to figure out how we can conditionally package the correct versions of those DLLs to be included; I don't think one targeting a 64-bit processor, with electron-build running the --ia32 flag, is just going to know to grab the x86 version of the similarly named DLL (or even how that would work with this packager).

We have to support appx, standalone installer (nsis-web), and a portable version of our app, so it's not as straightforward of a solution I'm sure as a lone Windows 10 Store app 🙁

cscharf avatar Jul 31 '20 13:07 cscharf