-
Notifications
You must be signed in to change notification settings - Fork 40
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
Can't resolve 'WebSdk' (React, Windows 10, U.are.U 4500 Fingerprint Reader) #27
Comments
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 |
no example provided, im frustated :(. Can you please help how to use this in vanillaJS or React |
Hello, the link to an example was provided many times, in a documentation and in a pinned issue #4. |
I managed to solve it. Make sure your websdk is in src folder. done :) |
While it may work in your specific case, I cannot recommend it. If you need to resort to hard-coded import paths instead of a module name, then it is most probably something wrong with your module resolution settings. I'd advise to find and fix the root cause of the problem. The WebSdk library must be in a list of "globals", like any other global JS library. For example, if you use a Webpack, then you need to add in into your Webpack config like this:
Also, if you use Typescript, you may need to add the path to your global modules into the
-- given that the WebSdk's Check documentation for your bundler and module resolution algoritm. |
I am using CRA, and the built-in webpack configuration is a spaghetti for me. It is better if i dont touch the webpack |
Hey @ahmed-alii , Do you figure this out with your react app? |
@a-bronx Hello sir! Can you help me on how to add WebSdk on globals of vite? Thank you! |
I have no familiarity with Vite, you'll need to read their docs. |
it's almost impossible to use the sdk in a next.js project, i have been trying for a couple of days now still stuck in the same "Module not found: Can't resolve 'WebSdk'" Error, please sir i need help on this one. |
H, Please take a look at the following. I have read the issues specifically #4 but not sure how it can be resolved in react app
./node_modules/@digitalpersona/devices/dist/es5.bundles/index.umd.js Module not found: Can't resolve 'WebSdk' in 'E:\digitalpersona-react-sample\node_modules\@digitalpersona\devices\dist\es5.bundles'
I am experiencing the above issue on a react sample provided here
My Setup
https://127.0.0.1:52181/get_connection ----->>> {"endpoint":"https://127.0.0.1:9001/?web_sdk_id=5e5a1211-0b1d-4f3a-8b18-ee057f7a6127&web_sdk_minport=9001&web_sdk_port=9001&web_sdk_secure=true&web_sdk_username=kY_fyw4wmJ4&web_sdk_password=8D2E5C87BDBE072F&web_sdk_salt=ACDCB7545A8C39CB3BB93613FEA54C9377A3A62C6ED6B9F545C49DF014DA13D3"}
This react app is rendering Client Side. So any kind of library included runs on the browser.
Index.html contains the
websdk.client.min.js
file.Other Libraries are included inside App.js
import {BioSample} from "@digitalpersona/core";
import {FingerprintsAuth} from '@digitalpersona/authentication';
import {IAuthService} from '@digitalpersona/services';
import {FingerprintReader, SampleFormat} from '@digitalpersona/devices';
The text was updated successfully, but these errors were encountered: