hidglobal / digitalpersona-devices

DigitalPersona Security Devices support library
https://hidglobal.github.io/digitalpersona-devices/index.html
MIT License
64 stars 41 forks source link

Module not found: Error: Can't resolve 'WebSdk' #28

Closed danielcuellarp closed 2 years ago

danielcuellarp commented 2 years ago

Hi,

When I create a variable and an instance of "FingerprintReader", the result is:

./node_modules/@digitalpersona/devices/dist/es6/devices/websdk/channel.js:3:0-16 - Error: Module not found: Error: Can't resolve 'WebSdk' in '...\node_modules\@digitalpersona\devices\dist\es6\devices\websdk'

image

I already have the index.js file in the script tags as mentioned.

image

a-bronx commented 2 years ago

Hello,

The WebSdk is a browser-only library, and must be loaded only into a browser context -- either as a static resource, or as a part of a bundle. The error message suggests that you try to load the WebSdk from the node_modules, which is clearly not expected to be seen in a browser. You must exclude the WedSdk library from a Node module resolution, and the code that depends on it must execute only in a browser as well.