Open sunnyso246 opened 1 year ago
Hi,
I add the library in my react project and always get this error. Please advise how to solve it.
ERROR in ./node_modules/bindings/bindings.js and Module not found: Error: Can't resolve 'fs' in node-modules.
Use react script 5.0.1 and webpack 5.
Thanks Sunny.
fs
is is Node.js provided context. React works inside browser, where Node.js context is unavailable.
This module works only in Node.js.
If we talk about the whole task - browser can not provide access to Smart Cards from JavaScript (React in your situation) directly. Is is possible only if host machine of user of your JavaScript provide some of interface for this. For example this interface is browser extension
For anyone trying to run this in Electron, the nodeIntegration
flag needs to be switched on to get access to fs
Hi,
I add the library in my react project and always get this error. Please advise how to solve it.
ERROR in ./node_modules/bindings/bindings.js and Module not found: Error: Can't resolve 'fs' in node-modules.
Use react script 5.0.1 and webpack 5.
Thanks Sunny.